Use Event.observe instead of the 'on' events which aren't properly cleaned

up in IE. #574. Patch by euzuro.  


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2912 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-03-28 21:11:47 +00:00
parent afa416fd2d
commit ee5d8eb73f

View File

@@ -82,9 +82,12 @@ OpenLayers.Control.Panel.prototype =
this.activateControl(ctrl);
};
var control = this.controls[i];
element.onclick = onClick.bind(this, control);
element.onmousedown = OpenLayers.Event.stop.bindAsEventListener();
element.onmouseup = OpenLayers.Event.stop.bindAsEventListener();
OpenLayers.Event.observe(element, "click",
onClick.bind(this, control));
OpenLayers.Event.observe(element, "mousedown",
OpenLayers.Event.stop.bindAsEventListener());
OpenLayers.Event.observe(element, "mouseup",
OpenLayers.Event.stop.bindAsEventListener());
this.div.appendChild(element);
}
}