[fusion-commits] r1971 - sandbox/jxlib-3.0/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Nov 11 10:57:55 EST 2009


Author: pagameba
Date: 2009-11-11 10:57:55 -0500 (Wed, 11 Nov 2009)
New Revision: 1971

Modified:
   sandbox/jxlib-3.0/widgets/Legend.js
Log:
fixing the legend for the newest jxlib build.

Modified: sandbox/jxlib-3.0/widgets/Legend.js
===================================================================
--- sandbox/jxlib-3.0/widgets/Legend.js	2009-11-11 15:31:46 UTC (rev 1970)
+++ sandbox/jxlib-3.0/widgets/Legend.js	2009-11-11 15:57:55 UTC (rev 1971)
@@ -702,10 +702,18 @@
     options: {
         template: '<li class="jxTreeContainer jxTreeLeaf"><img class="jxTreeImage" src="'+Jx.aPixel.src+'" alt="" title=""><span class="fusionLegendCheckboxContainer"><input type="checkbox" class="fusionLegendCheckboxInput"></span><a class="jxTreeItem fusionCheckboxItem" href="javascript:void(0);"><img class="jxTreeIcon" src="'+Jx.aPixel.src+'" alt="" title=""><span class="jxTreeLabel"></span></a><a class="fusionLayerInfo"><img class="fusionLayerInfoIcon" src="'+Jx.aPixel.src+'"></a></li>'
     },
-    classes: ['jxTreeContainer','jxTreeImage','jxTreeItem','jxTreeIcon','jxTreeLabel','fusionLegendCheckboxInput','fusionLayerInfo','fusionLayerInfoIcon'],
+    classes: new Hash({
+        domObj: 'jxTreeContainer', 
+        domA: 'jxTreeItem', 
+        domImg: 'jxTreeImage', 
+        domIcon: 'jxTreeIcon',
+        domLabel: 'jxTreeLabel',
+        checkbox: 'fusionLegendCheckboxInput',
+        layerInfo: 'fusionLayerInfo',
+        layerInfoIcon: 'fusionLayerInfoIcon'
+    }), 
     render: function() {
         this.parent();
-        this.checkbox = this.elements.get('fusionLegendCheckboxInput');
         if (this.checkbox) {
             if ($defined(this.options.checked)) {
                 this.check(this.options.checked);
@@ -740,11 +748,11 @@
     setLayerInfo: function(url, icon) {
         //change class to make fusionLayerInfo display block
         this.domObj.addClass('showFusionLayerInfo');
-        if (this.elements.get('fusionLayerInfo')) {
-            this.elements.get('fusionLayerInfo').set('href', url);
+        if (this.layerInfo) {
+            this.layerInfo.set('href', url);
         }
-        if (this.elements.get('fusionLayerInfoIcon')) {
-            this.elements.get('fusionLayerInfoIcon').set('src', icon);
+        if (this.layerInfoIcon) {
+            this.layerInfoIcon.set('src', icon);
         }
     }
 });
@@ -754,11 +762,21 @@
     options: {
         template: '<li class="jxTreeContainer jxTreeBranch"><img class="jxTreeImage" src="'+Jx.aPixel.src+'" alt="" title=""><span class="fusionLegendCheckboxContainer"><input type="checkbox" class="fusionLegendCheckboxInput"></span><a class="jxTreeItem fusionCheckboxItem" href="javascript:void(0);"><img class="jxTreeIcon" src="'+Jx.aPixel.src+'" alt="" title=""><span class="jxTreeLabel"></span></a><a class="fusionGroupInfo"><img class="fusionGroupInfoIcon" src="'+Jx.aPixel.src+'"></a><a class="fusionLayerInfo"><img class="fusionLayerInfoIcon" src="'+Jx.aPixel.src+'"></a><ul class="jxTree"></ul></li>'
     },
-    classes: ['jxTreeContainer','jxTreeImage','jxTreeItem','jxTreeIcon','jxTreeLabel','jxTree','fusionLegendCheckboxInput','fusionGroupInfo','fusionGroupInfoIcon','fusionLayerInfo','fusionLayerInfoIcon'],
+    classes: new Hash({
+        domObj: 'jxTreeContainer', 
+        domA: 'jxTreeItem', 
+        domImg: 'jxTreeImage', 
+        domIcon: 'jxTreeIcon',
+        domLabel: 'jxTreeLabel',
+        domTree: 'jxTree',
+        layerInfo: 'fusionLayerInfo',
+        layerInfoIcon: 'fusionLayerInfoIcon',
+        groupInfo: 'fusionGroupInfo',
+        groupInfoIcon: 'fusionGroupInfoIcon'
+    }),
     
     render: function() {
         this.parent();
-        this.checkbox = this.elements.get('fusionLegendCheckboxInput');
         if (this.checkbox) {
             if ($defined(this.options.checked)) {
                 this.check(this.options.checked);
@@ -793,22 +811,22 @@
     setLayerInfo: function(url, icon) {
         //change class to make fusionLayerInfo display block
         this.domObj.addClass('showFusionLayerInfo');
-        if (this.elements.get('fusionLayerInfo')) {
-            this.elements.get('fusionLayerInfo').set('href', url);
+        if (this.layerInfo) {
+            this.layerInfo.set('href', url);
         }
-        if (this.elements.get('fusionLayerInfoIcon')) {
-            this.elements.get('fusionLayerInfoIcon').set('src', icon);
+        if (this.layerInfoIcon) {
+            this.layerInfoIcon.set('src', icon);
         }
     },
     
     setGroupInfo: function(url, icon) {
         //change class to make fusionGroupInfo display block
         this.domObj.addClass('showFusionGroupInfo');
-        if (this.elements.get('fusionGroupInfo')) {
-            this.elements.get('fusionGroupInfo').set('href', url);
+        if (this.groupInfo) {
+            this.groupInfo.set('href', url);
         }
-        if (this.elements.get('fusionGroupInfoIcon')) {
-            this.elements.get('fusionGroupInfoIcon').set('src', icon);
+        if (this.groupInfoIcon) {
+            this.groupInfoIcon.set('src', icon);
         }
     }
 });
\ No newline at end of file



More information about the fusion-commits mailing list