From 233221e2e051b8a070907cdba3fa4880a8dcae5c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:17:38 +0000 Subject: [PATCH] MINOR More robust width/height detectino for layout manager in LeftAndMain.js git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92768 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index c5c14720..be3ceb25 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -89,9 +89,13 @@ var ss_MainLayout; */ _setupLayout: function() { var self = this; + + var widthEast = this.find('.ui-layout-east').width(); + var widthWest = this.find('.ui-layout-west').width(); // layout containing the tree, CMS menu, the main form etc. var savedLayoutSettings = layoutState.load('ss_MainLayout'); + var layoutSettings = jQuery.extend({ defaults: { // TODO Reactivate once we have localized values @@ -115,7 +119,7 @@ var ss_MainLayout; togglerLength_open: 0 }, west: { - size: this.find('.ui-layout-west').width(), + size: (widthWest) ? widthWest : undefined, fxName: "none" }, east: { @@ -124,8 +128,7 @@ var ss_MainLayout; // so a user shouldn't be able to toggle this panel manually initHidden: true, spacing_closed: 0, - fxName: "none", - size: this.find('.ui-layout-east').width() + fxName: "none" }, center: {} }, savedLayoutSettings);