[mapguide-commits] r5911 - branches/2.2/MgDev/Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jun 3 08:40:53 EDT 2011


Author: jng
Date: 2011-06-03 05:40:53 -0700 (Fri, 03 Jun 2011)
New Revision: 5911

Modified:
   branches/2.2/MgDev/Web/src/viewerfiles/mainframe.templ
Log:
#301: Fix Invoke URL not activating with multiple layers. The logic to enable/disable an invoke URL command based on its layer constraints was simply incorrect. However in the process of resolving this issue, another problem was discovered where layer constraints are disregarded if no URL parameters are specified. A separate ticket (#1712) has been created for that.

Modified: branches/2.2/MgDev/Web/src/viewerfiles/mainframe.templ
===================================================================
--- branches/2.2/MgDev/Web/src/viewerfiles/mainframe.templ	2011-06-03 11:56:12 UTC (rev 5910)
+++ branches/2.2/MgDev/Web/src/viewerfiles/mainframe.templ	2011-06-03 12:40:53 UTC (rev 5911)
@@ -603,21 +603,24 @@
                 var layers = cmd.layerConstraints;
                 if(layers.length > 0)
                 {
-                    var disable = false;
+                    var foundLayer = false;
                     var selLayers = GetMapFrame().GetSelectedLayers();
-                    for(var k=0; k < selLayers.length && !disable; k++)
+                    for(var k=0; k < selLayers.length; k++)
                     {
                         var selLayer = selLayers[k];
                         for(var j = 0; j < layers.length; j++)
                         {
-                            if(selLayer.name != layers[j])
+                            if(selLayer.name == layers[j])
                             {
-                                disable = true;
+                                foundLayer = true;
                                 break;
                             }
                         }
+                        
+                        if (foundLayer)
+                            break;
                     }
-                    if(disable)
+                    if(!foundLayer)
                     {
                         if(EnableCommand(cmd, false))
                             stateChanged = true;



More information about the mapguide-commits mailing list