diff --git a/javascripts/application.js b/javascripts/application.js index 8dc62dd3e..4277e5fb7 100644 --- a/javascripts/application.js +++ b/javascripts/application.js @@ -9,6 +9,23 @@ let normalized = false; +// String.includes function polyfill +// to add compatibility with older browsers +if ( !String.prototype.includes ) { + String.prototype.includes = function(search, start) { + 'use strict'; + if (typeof start !== 'number') { + start = 0; + } + + if (start + search.length > this.length) { + return false; + } else { + return this.indexOf(search,start) !== -1; + } + }; +} + function setupProjectInput() { $(config.projectInput).on('change', function () { if(!this.value) {