[mapguide-commits] r7416 - in branches/2.5/MgDev/Oem/fusionMG/templates/mapguide: limegold maroon slate

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Mar 26 08:37:29 PDT 2013


Author: jng
Date: 2013-03-26 08:37:28 -0700 (Tue, 26 Mar 2013)
New Revision: 7416

Modified:
   branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.html
   branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.html
   branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/slate/index.html
Log:
This submission includes the following changes:
 - #2228: Fix broken sidebar toggle behaviour in LimeGold template
 - http://trac.osgeo.org/fusion/ticket/539: Improve the UX for templates with collapsible sidebars. If a request is made to show any region within the the collapsible sidebar, whether through widget invocation or calling any one of the showXXX() functions in the template, expand the sidebar if is already collapsed.

Modified: branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.html
===================================================================
--- branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.html	2013-03-26 11:03:36 UTC (rev 7415)
+++ branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.html	2013-03-26 15:37:28 UTC (rev 7416)
@@ -21,6 +21,7 @@
 var tab2;
 var tab3;
 var tabbox1;
+var COLLAPSED_SIDEBAR_WIDTH = 8;
 
 window.onload = function() {
     Fusion.initializeLocale();  //need to call this first if String.Translate is to be used in the onload
@@ -38,7 +39,7 @@
         splitInto:2,
         elements:[$('Main'),$('Sidebar')],
         layout:'horizontal',
-        containerOptions: [{},{minWidth:50, width: 214}],
+        containerOptions: [{},{minWidth:COLLAPSED_SIDEBAR_WIDTH, width: 214}],
         barOptions: [{
             snap: 'after',
             snapElement: $('SidebarCollapse'),
@@ -174,18 +175,27 @@
 }
 
 var showOverviewMap = function() {
+    showSidebarIfCollapsed();
 }
 
+var showSidebarIfCollapsed = function() {
+    if ($("Sidebar").getWidth() <= COLLAPSED_SIDEBAR_WIDTH)
+        $("SidebarCollapse").fireEvent("click");
+};
+
 var showTaskPane = function() {
-  tab1.setActive(true);
+    showSidebarIfCollapsed();
+    tab1.setActive(true);
 }
 
 var showLegend = function() {
-  tab2.setActive(true);
+    showSidebarIfCollapsed();
+    tab2.setActive(true);
 }
 
 var showSelectionPanel = function() {
-  tab3.setActive(true);
+    showSidebarIfCollapsed();
+    tab3.setActive(true);
 }
 
 </script>

Modified: branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.html
===================================================================
--- branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.html	2013-03-26 11:03:36 UTC (rev 7415)
+++ branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.html	2013-03-26 15:37:28 UTC (rev 7416)
@@ -24,6 +24,7 @@
 var panel3;
 var panel4;
 var panelman;
+var COLLAPSED_SIDEBAR_WIDTH = 8;
 
 window.onload = function() {
     Fusion.initializeLocale();  //need to call this first if String.Translate is to be used in the onload
@@ -70,7 +71,7 @@
         splitInto:2,
         elements:[$('MapArea'),$('Sidebar')],
         layout:'horizontal',
-        containerOptions: [{},{minWidth:8, width: 218}],
+        containerOptions: [{},{minWidth:COLLAPSED_SIDEBAR_WIDTH, width: 218}],
         barOptions: [
             {
                 snap: 'after', 
@@ -195,20 +196,29 @@
     isTaskPaneRegistered = true;
 }
 
+var showSidebarIfCollapsed = function() {
+    if ($("Sidebar").getWidth() <= (COLLAPSED_SIDEBAR_WIDTH + 1)) //Template-specific
+        $("SidebarCollapse").fireEvent("click");
+};
+
 var showOverviewMap = function() {
-  panelman.maximizePanel(panel4);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel4);
 }
 
 var showTaskPane = function() {
-  panelman.maximizePanel(panel3);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel3);
 }
 
 var showLegend = function() {
-  panelman.maximizePanel(panel1);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel1);
 }
 
 var showSelectionPanel = function() {
-  panelman.maximizePanel(panel2);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel2);
 }
 
 </script>

Modified: branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/slate/index.html
===================================================================
--- branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/slate/index.html	2013-03-26 11:03:36 UTC (rev 7415)
+++ branches/2.5/MgDev/Oem/fusionMG/templates/mapguide/slate/index.html	2013-03-26 15:37:28 UTC (rev 7416)
@@ -20,6 +20,7 @@
 var panel3;
 var panelman;
 var dOverviewMap;
+var COLLAPSED_SIDEBAR_WIDTH = 8;
 
 window.onload = function() {
     Fusion.initializeLocale();  //need to call this first if String.Translate is to be used in the onload
@@ -36,7 +37,7 @@
         splitInto:2,
         elements:[$('Sidebar'),$('MapArea')],
         layout:'horizontal',
-        containerOptions: [{minWidth:8, width: 218}],
+        containerOptions: [{minWidth:COLLAPSED_SIDEBAR_WIDTH, width: 218}],
         barOptions: [{
             snap: 'before',
             snapElement: $('SidebarCollapse'),
@@ -128,9 +129,9 @@
     //Case 2: For dealing with Function: ajaxException. (fusion.js)
     //******************************************
     //        ajaxException: function(r, e) {
-    //        this.reportError(new Fusion.Error(Fusion.Error.WARNING, 
-    //            OpenLayers.i18n('ajaxError', {'exception':e.message, 
-    //                                          'filename':e.fileName, 
+    //        this.reportError(new Fusion.Error(Fusion.Error.WARNING,
+    //            OpenLayers.i18n('ajaxError', {'exception':e.message,
+    //                                          'filename':e.fileName,
     //                                          'line':e.lineNumber,
     //                                          'response': r.transport.responseText
     //                                          })));
@@ -180,16 +181,24 @@
     dOverviewMap.open();
 }
 
+var showSidebarIfCollapsed = function() {
+    if ($("Sidebar").getWidth() <= COLLAPSED_SIDEBAR_WIDTH)
+        $("SidebarCollapse").fireEvent("click");
+};
+
 var showTaskPane = function() {
-  panelman.maximizePanel(panel3);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel3);
 }
 
 var showLegend = function() {
-  panelman.maximizePanel(panel1);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel1);
 }
 
 var showSelectionPanel = function() {
-  panelman.maximizePanel(panel2);
+    showSidebarIfCollapsed();
+    panelman.maximizePanel(panel2);
 }
 
 </script>



More information about the mapguide-commits mailing list