From 3f4aba55454f5c27486e208a9517ed1c65ead2a9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 30 Mar 2012 15:23:39 +0200 Subject: [PATCH] MINOR Avoid breaking IE on CMS ajax responses which don't contain CSS class names (splitting on NULL) (#7002) --- admin/javascript/LeftAndMain.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index b8c77f4f0..a7a502a3d 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -223,12 +223,13 @@ jQuery.noConflict(); var layoutClasses = ['east', 'west', 'center', 'north', 'south']; var elemClasses = contentEl.attr('class'); - var origLayoutClasses = $.grep( - elemClasses.split(' '), - function(val) { - return ($.inArray(val, layoutClasses) >= 0); - } - ); + var origLayoutClasses = ''; + if(elemClasses) { + origLayoutClasses = $.grep( + elemClasses.split(' '), + function(val) { return ($.inArray(val, layoutClasses) >= 0);} + ); + } newContentEl .removeClass(layoutClasses.join(' '))