From b07f8f3fe4daadb5093d9cac2fbb5984ea24fe2e Mon Sep 17 00:00:00 2001 From: NOYB Date: Thu, 30 Jun 2016 17:40:59 -0700 Subject: [PATCH] startsWith Polyfill Fixes hidding of custom individual settings when not in use on user manager page. --- src/usr/local/www/js/polyfills.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/usr/local/www/js/polyfills.js b/src/usr/local/www/js/polyfills.js index 268ca1f274..fb00564650 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; + }; +}