Ticket #604: eventsDestroy.patch
| File eventsDestroy.patch, 1.2 kB (added by euzuro, 2 years ago) |
|---|
-
lib/OpenLayers/Events.js
old new 275 275 */ 276 276 destroy: function () { 277 277 if (this.element) { 278 this.detachFromElement();278 OpenLayers.Event.stopObservingElement(this.element); 279 279 } 280 280 this.element = null; 281 281 … … 304 304 // disable dragstart in IE so that mousedown/move/up works normally 305 305 OpenLayers.Event.observe(element, "dragstart", OpenLayers.Event.stop); 306 306 }, 307 308 /**309 * @private310 */311 detachFromElement: function () {312 for (var i = 0; i < this.BROWSER_EVENTS.length; i++) {313 var eventType = this.BROWSER_EVENTS[i];314 307 315 OpenLayers.Event.stopObserving(316 this.element, eventType, this.eventHandler);317 }318 319 // re-enable dragstart in IE320 OpenLayers.Event.stopObserving(321 this.element, "dragstart", OpenLayers.Event.stop);322 },323 324 308 /** 325 309 * @param {String} type Name of the event to register 326 310 * @param {Object} obj The object to bind the context to for the callback#.
