[Commits] r997 - sandbox/camptocamp/geobretagne/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Fri Jun 5 16:09:18 CEST 2009


Author: fredj
Date: 2009-06-05 16:09:17 +0200 (Fri, 05 Jun 2009)
New Revision: 997

Modified:
   sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LayerOpacitySlider.js
Log:
work on the LayerOpacitySlider constructor

Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LayerOpacitySlider.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LayerOpacitySlider.js	2009-06-04 23:20:47 UTC (rev 996)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LayerOpacitySlider.js	2009-06-05 14:09:17 UTC (rev 997)
@@ -17,20 +17,20 @@
     minValue: 0,
     maxValue: 100,
 
-// FIXME: test this:
-//     /** private */
-//     constructor: function(config) {
-//         if (config.layer) {
-//             if (config.layer instanceof OpenLayers.Layer) {
-//                 this.layer = config.layer;
-//             } else if (config.layer instanceof GeoExt.data.LayerRecord || 
-//                        config.layer instanceof GeoExt.tree.LayerNode) {
-//                 this.layer = config.layer.layer;
-//             }
-//             delete config.layer;
-//         }
-//         GeoExt.LayerOpacitySlider.superclass.constructor.call(this, config);
-//     },
+    /** private */
+    constructor: function(config) {
+        if (config.layer) {
+            if (config.layer instanceof OpenLayers.Layer) {
+                this.layer = config.layer;
+            } else if (config.layer instanceof GeoExt.data.LayerRecord) {
+                this.layer = config.layer.get('layer');
+            } else if (config.layer instanceof GeoExt.tree.LayerNode) {
+                this.layer = config.layer.layer;
+            }
+            delete config.layer;
+        }
+        GeoExt.LayerOpacitySlider.superclass.constructor.call(this, config);
+    },
 
     initComponent: function() {
         // set the slider initial value



More information about the Commits mailing list