From e643742eb3428c6a0cf6322f09152f22d00e0502 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Thu, 14 Feb 2013 12:59:26 +0100 Subject: [PATCH] adding prototype trim as fallback for IE8 --- core/js/compatibility.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/js/compatibility.js b/core/js/compatibility.js index 3e9178f320..0cfeefab87 100644 --- a/core/js/compatibility.js +++ b/core/js/compatibility.js @@ -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