[mapguide-commits] r6574 - branches/2.4/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Apr 12 08:46:54 EDT 2012


Author: jng
Date: 2012-04-12 05:46:54 -0700 (Thu, 12 Apr 2012)
New Revision: 6574

Modified:
   branches/2.4/MgDev/Web/src/viewerfiles/ajaxmappane.templ
   branches/2.4/MgDev/Web/src/viewerfiles/toolbar.templ
Log:
#1983: Fix bad toggling behaviour of the MapTip command. This submission allows the MapTip command to be in any position on the toolbar (or multiples of them. Don't ask why, it is possible), because we now know the exact positions of these toolbar items.

Modified: branches/2.4/MgDev/Web/src/viewerfiles/ajaxmappane.templ
===================================================================
--- branches/2.4/MgDev/Web/src/viewerfiles/ajaxmappane.templ	2012-04-12 12:46:12 UTC (rev 6573)
+++ branches/2.4/MgDev/Web/src/viewerfiles/ajaxmappane.templ	2012-04-12 12:46:54 UTC (rev 6574)
@@ -2221,28 +2221,36 @@
 
 function MapTip()
 {
-    var maptipBtn = parent.tbFrame.document.getElementById(14)
+    var idxes = parent.tbFrame.GetMapTipButtons();
     if(!haveTooltip)
     {
         haveTooltip = true;
-        //The tooltip is enabled.
-        //highlight the maptip button via change the background and the border color
-        if(maptipBtn)
-        {
-            maptipBtn.style.border = "solid #a0a0a0 1px";
-            maptipBtn.style.background = "#dcdcdc";
+        for (var i = 0; i < idxes.length; i++) {
+            var maptipBtn = parent.tbFrame.document.getElementById(idxes[i]);
+            //The tooltip is enabled.
+            //highlight the maptip button via change the background and the border color
+            if(maptipBtn)
+            {
+                maptipBtn.style.border = "solid #a0a0a0 1px";
+                maptipBtn.style.background = "#dcdcdc";
+            }
         }
     }
     else
     {
         haveTooltip = false;
-        document.getElementById("hlTip").style.display = 'none';
-        //disable the tooltip
-        //change back the background and border color
-        if(maptipBtn)
-        {
-            maptipBtn.style.border = "solid #f0f0f0 1px";
-            maptipBtn.style.background = "#f0f0f0";
+        var tip = document.getElementById("hlTip");
+        if (tip != null)
+            tip.style.display = 'none';
+        for (var i = 0; i < idxes.length; i++) {
+            var maptipBtn = parent.tbFrame.document.getElementById(idxes[i]);
+            //disable the tooltip
+            //change back the background and border color
+            if(maptipBtn)
+            {
+                maptipBtn.style.border = "solid #f0f0f0 1px";
+                maptipBtn.style.background = "#f0f0f0";
+            }
         }
     }
 }

Modified: branches/2.4/MgDev/Web/src/viewerfiles/toolbar.templ
===================================================================
--- branches/2.4/MgDev/Web/src/viewerfiles/toolbar.templ	2012-04-12 12:46:12 UTC (rev 6573)
+++ branches/2.4/MgDev/Web/src/viewerfiles/toolbar.templ	2012-04-12 12:46:54 UTC (rev 6574)
@@ -52,6 +52,7 @@
 var intId;
 var btnActions = new Array();
 var btnStates = new Array();
+var mapTipBtns = new Array();
 
 // public functions -----------------------------------------------
 //
@@ -194,6 +195,8 @@
     return metrics.offsetWidth;
 }
 
+function GetMapTipButtons() { return mapTipBtns; }
+
 function InitToolbar()
 {
     var commands = parent.commands;
@@ -231,9 +234,11 @@
                    "  </span>\n" +
                    "</td>\n";
 
-                btnActions[i] = cmd.action;
-                btnStates[i] = cmd.enabled;
-                curPosX += 28;
+            btnActions[i] = cmd.action;
+            btnStates[i] = cmd.enabled;
+            if (cmd.action == 34) //34 - MapTip
+                mapTipBtns.push(i);
+            curPosX += 28;
         }
         else if(tbItem.type == 3)
         {



More information about the mapguide-commits mailing list