[mapguide-commits] r6273 - trunk/MgDev/Web/src/mapadmin

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Dec 2 04:06:56 EST 2011


Author: liuar
Date: 2011-12-02 01:06:56 -0800 (Fri, 02 Dec 2011)
New Revision: 6273

Modified:
   trunk/MgDev/Web/src/mapadmin/performanceReport.php
Log:
On behalf of Ted Yang.
fix the ticket 1768: http://trac.osgeo.org/mapguide/ticket/1768
	
This submission is mainly fixed 1 UI defect:
Mouse Wheel will also scroll down / up the web page besides the "Select Settings" dialog, use js to disable the body scroll when the "select settings" dialogue is popup

Modified: trunk/MgDev/Web/src/mapadmin/performanceReport.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/performanceReport.php	2011-12-02 05:48:03 UTC (rev 6272)
+++ trunk/MgDev/Web/src/mapadmin/performanceReport.php	2011-12-02 09:06:56 UTC (rev 6273)
@@ -959,6 +959,11 @@
                 mapFrame.src = "performanceReport_MapViewer.php?mapDefinition=" + mapDefinitonSelector.options[mapDefinitonSelector.selectedIndex].value;
             }
 
+            //when open the dialogue, scroll to the top
+            window.scrollTo(0,0);
+            //disable the scroll bar
+            document.body.style.overflow = "hidden";
+
             var bgDiv = document.getElementById("bgDiv");
             var mapViewerDiv = document.getElementById("mapViewerDialog");
 
@@ -993,8 +998,13 @@
 
         function SetBgDivSize(bgDiv)
         {
-            bgDiv.style.height = document.body.offsetHeight+"px";
-            bgDiv.style.width = document.body.offsetWidth+"px";
+           //different browsers explain the offsetHeight, clientWidth differently,
+           //so we add a spacing to the height and width
+           //because the overflow of the body will be set as "hidden"
+           //so the exceed part will not be displayed and ensure the bgDiv will conver the whole webpage
+           var spacing = 32;
+           bgDiv.style.height = document.body.offsetHeight + spacing + "px";
+           bgDiv.style.width = document.body.offsetWidth + spacing + "px";
         }
 
         //default map viewer width and height
@@ -1101,6 +1111,10 @@
             //will get the old page's frame and then the buttons will not be displayed in new page
             var mapFrame = document.getElementById("mapViewerFrame");
             mapFrame.src="";
+
+            //set the overflow to "auto", so after close the dialogue
+            //the page will back to normal
+            document.body.style.overflow = "auto";
         }
 
         var messageShorterInterval = null;



More information about the mapguide-commits mailing list