fix for #847 - use bind() instead of bindAsEventListener()= when appropriate

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3786 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-07-23 15:03:42 +00:00
parent 8ee8522e0a
commit e8a4938258
5 changed files with 10 additions and 11 deletions

View File

@@ -211,7 +211,7 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
for(var i=0; i < this.layer.map.popups.length; i++) { for(var i=0; i < this.layer.map.popups.length; i++) {
this.layer.map.removePopup(this.layer.map.popups[i]); this.layer.map.removePopup(this.layer.map.popups[i]);
} }
}.bindAsEventListener(this)); }.bind(this));
this.layer.map.addPopup(popup); this.layer.map.addPopup(popup);
} }
OpenLayers.Event.stop(evt); OpenLayers.Event.stop(evt);

View File

@@ -201,7 +201,7 @@ OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class(
this.events.triggerEvent("loadend"); this.events.triggerEvent("loadend");
} }
OpenLayers.Event.observe(this.tile.imgDiv, 'load', OpenLayers.Event.observe(this.tile.imgDiv, 'load',
onload.bindAsEventListener(this)); onload.bind(this));
} else { } else {
this.tile.moveTo(tileBounds, pos); this.tile.moveTo(tileBounds, pos);
} }

View File

@@ -298,7 +298,7 @@ OpenLayers.Map = OpenLayers.Class({
// Note that this is ok, as updateSize() does nothing if the // Note that this is ok, as updateSize() does nothing if the
// map's size has not actually changed. // map's size has not actually changed.
OpenLayers.Event.observe(window, 'resize', OpenLayers.Event.observe(window, 'resize',
this.updateSize.bindAsEventListener(this)); this.updateSize.bind(this));
} }
// only append link stylesheet if the theme property is set // only append link stylesheet if the theme property is set
@@ -343,7 +343,7 @@ OpenLayers.Map = OpenLayers.Class({
this.popups = new Array(); this.popups = new Array();
this.unloadDestroy = this.destroy.bindAsEventListener(this); this.unloadDestroy = this.destroy.bind(this);
// always call map.destroy() // always call map.destroy()

View File

@@ -194,7 +194,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
http://openlayers.org/pipermail/dev/2007-January/000205.html http://openlayers.org/pipermail/dev/2007-January/000205.html
OpenLayers.Event.observe( this.imgDiv, "load", OpenLayers.Event.observe( this.imgDiv, "load",
this.checkImgURL.bindAsEventListener(this) ); this.checkImgURL.bind(this) );
*/ */
this.frame.appendChild(this.imgDiv); this.frame.appendChild(this.imgDiv);
this.layer.div.appendChild(this.frame); this.layer.div.appendChild(this.frame);
@@ -223,8 +223,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
this.events.triggerEvent("loadend"); this.events.triggerEvent("loadend");
} }
} }
OpenLayers.Event.observe(this.imgDiv, 'load', OpenLayers.Event.observe(this.imgDiv, 'load', onload.bind(this));
onload.bindAsEventListener(this));
}, },

View File

@@ -239,9 +239,9 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
if(delayDisplay) { if(delayDisplay) {
image.style.display = "none"; image.style.display = "none";
OpenLayers.Event.observe(image, "load", OpenLayers.Event.observe(image, "load",
OpenLayers.Util.onImageLoad.bindAsEventListener(image)); OpenLayers.Util.onImageLoad.bind(image));
OpenLayers.Event.observe(image, "error", OpenLayers.Event.observe(image, "error",
OpenLayers.Util.onImageLoadError.bindAsEventListener(image)); OpenLayers.Util.onImageLoadError.bind(image));
} }
@@ -434,9 +434,9 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
if (delayDisplay) { if (delayDisplay) {
img.style.display = "none"; img.style.display = "none";
OpenLayers.Event.observe(img, "load", OpenLayers.Event.observe(img, "load",
OpenLayers.Util.onImageLoad.bindAsEventListener(div)); OpenLayers.Util.onImageLoad.bind(div));
OpenLayers.Event.observe(img, "error", OpenLayers.Event.observe(img, "error",
OpenLayers.Util.onImageLoadError.bindAsEventListener(div)); OpenLayers.Util.onImageLoadError.bind(div));
} }
OpenLayers.Util.modifyAlphaImageDiv(div, id, px, sz, imgURL, position, OpenLayers.Util.modifyAlphaImageDiv(div, id, px, sz, imgURL, position,