From f816ab853fa3d6f5c927a2f97706038f55bdb58f Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Fri, 28 Feb 2014 12:39:34 +0100 Subject: [PATCH] Safari compat --- js/init.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/init.js b/js/init.js index 25b44e0..8800839 100644 --- a/js/init.js +++ b/js/init.js @@ -13,5 +13,14 @@ var webui = angular.module('webui', [ ]); $(function() { + if (!String.prototype.startsWith) { + Object.defineProperty(String.prototype, 'startsWith', { + enumerable: false, configurable: false, writable: false, + value: function (searchString, position) { + position = position || 0; + return this.indexOf(searchString, position) === position; + } + }); + } angular.bootstrap(document, ['webui']) });