diff --git a/workflow/engine/controllers/dashboard.php b/workflow/engine/controllers/dashboard.php index 2a74544d3..f37f63ecc 100644 --- a/workflow/engine/controllers/dashboard.php +++ b/workflow/engine/controllers/dashboard.php @@ -28,7 +28,7 @@ class Dashboard extends Controller try { $dashletsExist = $this->getDashletsInstancesForCurrentUser(); $dashletsHide = array(); - $dashletColumns = 3; + $dashletColumns = 2; G::LoadClass( 'configuration' ); $oConfiguration = new Configurations(); @@ -447,4 +447,3 @@ class Dashboard extends Controller // Functions for the dasboards administration module - End } - diff --git a/workflow/engine/templates/dashboard/index.js b/workflow/engine/templates/dashboard/index.js index 179b42b73..832a35a4f 100644 --- a/workflow/engine/templates/dashboard/index.js +++ b/workflow/engine/templates/dashboard/index.js @@ -42,6 +42,7 @@ var reallocate = function (cols) { } }.defaults(3); + Ext.onReady(function(){ Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); @@ -141,7 +142,6 @@ Ext.onReady(function(){ } }; */ - pd.items.items[0].columnWidth = 0.49; pd.items.items[1].columnWidth = 0.49; pd.items.items[2].columnWidth = 0.01; @@ -320,28 +320,47 @@ Ext.onReady(function(){ } } - - pd.doLayout(); - - if (dashletsColumns == 2) { - tbDashboard.items.items[0].setDisabled(false); - tbDashboard.items.items[1].setDisabled(true); - - var pd = Ext.getCmp('portalDashboard'); - - pd.items.items[0].columnWidth = 0.49; - pd.items.items[1].columnWidth = 0.49; - pd.items.items[2].columnWidth = 0.01; - pd.doLayout(); - } else { - var pd = Ext.getCmp('portalDashboard'); - - pd.items.items[0].columnWidth = 0.33; - pd.items.items[1].columnWidth = 0.33; - pd.items.items[2].columnWidth = 0.33; pd.doLayout(); - tbDashboard.items.items[0].setDisabled(true); - tbDashboard.items.items[1].setDisabled(false); - } + switch(dashletsColumns) { + case 1: + var pd = Ext.getCmp("portalDashboard"); + reallocate(1); + + pd.items.items[0].columnWidth = 0.98; + pd.items.items[1].columnWidth = 0.01; + pd.items.items[2].columnWidth = 0.01; + pd.doLayout(); + + tbDashboard.items.items[0].setDisabled(false); + tbDashboard.items.items[1].setDisabled(false); + tbDashboard.items.items[2].setDisabled(true); + break; + case 2: + var pd = Ext.getCmp("portalDashboard"); + reallocate(2); + + pd.items.items[0].columnWidth = 0.49; + pd.items.items[1].columnWidth = 0.49; + pd.items.items[2].columnWidth = 0.01; + pd.doLayout(); + + tbDashboard.items.items[0].setDisabled(false); + tbDashboard.items.items[1].setDisabled(true); + tbDashboard.items.items[2].setDisabled(false); + break; + case 3: + var pd = Ext.getCmp("portalDashboard"); + reallocate(3); + + pd.items.items[0].columnWidth = 0.33; + pd.items.items[1].columnWidth = 0.33; + pd.items.items[2].columnWidth = 0.33; + pd.doLayout(); + + tbDashboard.items.items[0].setDisabled(true); + tbDashboard.items.items[1].setDisabled(false); + tbDashboard.items.items[2].setDisabled(false); + break; + } });