[Commits] r2229 - core/trunk/geoext/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Tue Jun 29 11:50:30 CEST 2010
Author: ahocevar
Date: 2010-06-29 11:50:30 +0200 (Tue, 29 Jun 2010)
New Revision: 2229
Modified:
core/trunk/geoext/lib/GeoExt/widgets/LayerOpacitySlider.js
Log:
make LayerOpacitySlider work in Ext >= 3.2 by setting the value config option before super's constructor is invoked. This is necessary because the super's constructor does the config juggling to turn config.value into the first item of the this.values array. p=juliensam, r=me (closes #289)
Modified: core/trunk/geoext/lib/GeoExt/widgets/LayerOpacitySlider.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/LayerOpacitySlider.js 2010-06-29 08:46:19 UTC (rev 2228)
+++ core/trunk/geoext/lib/GeoExt/widgets/LayerOpacitySlider.js 2010-06-29 09:50:30 UTC (rev 2229)
@@ -146,6 +146,14 @@
config.complementaryLayer.get('layer');
}
+ if (this.layer && this.layer.opacity !== null) {
+ config.value = parseInt(
+ this.layer.opacity * (this.maxValue - this.minValue)
+ );
+ } else if (config.value === undefined) {
+ config.value = this.maxValue;
+ }
+
delete config.layer;
delete config.complementaryLayer;
}
@@ -156,14 +164,6 @@
* Initialize the component.
*/
initComponent: function() {
- // set the slider initial value
- if (this.layer && this.layer.opacity !== null) {
- this.value = parseInt(
- this.layer.opacity * (this.maxValue - this.minValue)
- );
- } else if (this.value == null) {
- this.value = this.maxValue;
- }
GeoExt.LayerOpacitySlider.superclass.initComponent.call(this);
More information about the Commits
mailing list