Browse Source

fixed missing capitalize function if startsWith exists

Marc Chappuis (marcha) 6 years ago
parent
commit
430906eea3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      site/script/main.js

+ 3 - 1
site/script/main.js

@@ -15,9 +15,11 @@ function loadmap(){
         String.prototype.startsWith = function (str){
             return this.indexOf(str) == 0;
         };
+    }
+	if (typeof String.prototype.capitalize != 'function') {
         String.prototype.capitalize = function(str) {
             return this.charAt(0).toUpperCase() + this.slice(1).toLowerCase();
-        }
+        };
     }
 }