summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-06-30 17:40:59 -0700
committerNOYB <Al_Stu@Frontier.com>2016-06-30 17:40:59 -0700
commitb07f8f3fe4daadb5093d9cac2fbb5984ea24fe2e (patch)
tree5f408aa1af8afd83c3d823c1e2546ec5f044d87e
parentf5ba05cbeee0631beee2db37d4ed74eadde7020e (diff)
downloadpfsense-b07f8f3fe4daadb5093d9cac2fbb5984ea24fe2e.zip
pfsense-b07f8f3fe4daadb5093d9cac2fbb5984ea24fe2e.tar.gz
startsWith Polyfill
Fixes hidding of custom individual settings when not in use on user manager page.
-rw-r--r--src/usr/local/www/js/polyfills.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/usr/local/www/js/polyfills.js b/src/usr/local/www/js/polyfills.js
index 268ca1f..fb00564 100644
--- a/src/usr/local/www/js/polyfills.js
+++ b/src/usr/local/www/js/polyfills.js
@@ -20,3 +20,18 @@ if (!String.prototype.includes) {
}
};
}
+
+/***
+**
+** Polyfill for older browsers that don't yet have the newer string "startsWith()" method implemented.
+** Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill
+** Documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
+**
+***/
+
+if (!String.prototype.startsWith) {
+ String.prototype.startsWith = function(searchString, position){
+ position = position || 0;
+ return this.substr(position, searchString.length) === searchString;
+ };
+}
OpenPOWER on IntegriCloud