diff options
author | NOYB <Al_Stu@Frontier.com> | 2016-06-30 17:40:59 -0700 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2016-06-30 20:10:21 -0500 |
commit | f3174943b521c154ce9fc445cbedee543cbdc424 (patch) | |
tree | 8dc0bb8d2d515c3d3049b02dede76e7aecab518e | |
parent | 327052d033083ff12f399ed5a4dc642bdd04de2c (diff) | |
download | pfsense-f3174943b521c154ce9fc445cbedee543cbdc424.zip pfsense-f3174943b521c154ce9fc445cbedee543cbdc424.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.js | 15 |
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; + }; +} |