[fusion-commits] r2125 - sandbox/jxlib-3.0/widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Mar 31 16:01:02 EDT 2010
Author: madair
Date: 2010-03-31 16:01:00 -0400 (Wed, 31 Mar 2010)
New Revision: 2125
Modified:
sandbox/jxlib-3.0/widgets/Legend.js
Log:
temproary fix for Legend icon sprite offsets, img.getStyle() is not working for IE
Modified: sandbox/jxlib-3.0/widgets/Legend.js
===================================================================
--- sandbox/jxlib-3.0/widgets/Legend.js 2010-03-31 19:17:23 UTC (rev 2124)
+++ sandbox/jxlib-3.0/widgets/Legend.js 2010-03-31 20:01:00 UTC (rev 2125)
@@ -234,6 +234,7 @@
* {Boolean} Determine if non-visible layer must be draw in the legend.
*/
bIncludeVisToggle: true,
+ offsetsCalculated: false,
initialize: function(legend, widgetTag) {
Fusion.Widget.Legend.LegendRenderer.prototype.initialize.apply(this, [legend]);
@@ -377,7 +378,7 @@
var baseLayer = this.getMap().aMaps[0];
baseLayer.registerForEvent(Fusion.Event.MAP_LAYER_ORDER_CHANGED, OpenLayers.Function.bind(this.mapRefresh, this));
this.layerRoot = this.getMap().layerRoot;
- this.renderLegend();
+ //this.renderLegend();
},
mapReloaded: function() {
@@ -681,8 +682,9 @@
var d = new Element('div', {'class':'fusionLegendTreeRoot'});
img.setStyle('visiblity','hidden');
img.inject(d);
- var w = img.getStyle('width').toInt();
- var h = img.getStyle('height').toInt();
+ //TODO: img.getStyle doesn't seem to work for IE, need another solution here
+ var w = 16;//img.getStyle('width').toInt();
+ var h = 16;//img.getStyle('height').toInt();
if (!sibling) {
img.inject(parent,'top');
} else {
@@ -691,6 +693,7 @@
img.setStyle('visibility','visible');
this.iconWidth = (style.iconOpt.width - w)/2;
this.iconHeight = (style.iconOpt.height - h)/2;
+ //alert(w+":"+h);
this.offsetsCalculated = true;
}
iconX = -1 * (style.iconX + this.iconWidth);
More information about the fusion-commits
mailing list