startsWith Polyfill

Fixes hidding of custom individual settings when not in use on user manager page.
This commit is contained in:
NOYB 2016-06-30 17:40:59 -07:00
parent f5ba05cbee
commit b07f8f3fe4

View File

@ -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;
};
}