]> source.dussan.org Git - nextcloud-server.git/commitdiff
adding prototype trim as fallback for IE8
authorThomas Mueller <thomas.mueller@tmit.eu>
Thu, 14 Feb 2013 11:59:26 +0000 (12:59 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Thu, 14 Feb 2013 11:59:26 +0000 (12:59 +0100)
core/js/compatibility.js

index 3e9178f3200e05b460d23e5005e3ff26db495954..0cfeefab87128329f43dceb35c473fc806c70ca4 100644 (file)
@@ -23,3 +23,10 @@ if (!Function.prototype.bind) {
                return fBound;
        };
 }
+
+//https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim
+if(!String.prototype.trim) {
+       String.prototype.trim = function () {
+               return this.replace(/^\s+|\s+$/g,'');
+       };
+}
\ No newline at end of file