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:
@@ -211,7 +211,7 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
|
||||
for(var i=0; i < this.layer.map.popups.length; i++) {
|
||||
this.layer.map.removePopup(this.layer.map.popups[i]);
|
||||
}
|
||||
}.bindAsEventListener(this));
|
||||
}.bind(this));
|
||||
this.layer.map.addPopup(popup);
|
||||
}
|
||||
OpenLayers.Event.stop(evt);
|
||||
|
||||
@@ -201,7 +201,7 @@ OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class(
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
OpenLayers.Event.observe(this.tile.imgDiv, 'load',
|
||||
onload.bindAsEventListener(this));
|
||||
onload.bind(this));
|
||||
} else {
|
||||
this.tile.moveTo(tileBounds, pos);
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
// Note that this is ok, as updateSize() does nothing if the
|
||||
// map's size has not actually changed.
|
||||
OpenLayers.Event.observe(window, 'resize',
|
||||
this.updateSize.bindAsEventListener(this));
|
||||
this.updateSize.bind(this));
|
||||
}
|
||||
|
||||
// only append link stylesheet if the theme property is set
|
||||
@@ -343,7 +343,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
|
||||
this.popups = new Array();
|
||||
|
||||
this.unloadDestroy = this.destroy.bindAsEventListener(this);
|
||||
this.unloadDestroy = this.destroy.bind(this);
|
||||
|
||||
|
||||
// always call map.destroy()
|
||||
|
||||
@@ -194,7 +194,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
http://openlayers.org/pipermail/dev/2007-January/000205.html
|
||||
|
||||
OpenLayers.Event.observe( this.imgDiv, "load",
|
||||
this.checkImgURL.bindAsEventListener(this) );
|
||||
this.checkImgURL.bind(this) );
|
||||
*/
|
||||
this.frame.appendChild(this.imgDiv);
|
||||
this.layer.div.appendChild(this.frame);
|
||||
@@ -223,8 +223,7 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
}
|
||||
OpenLayers.Event.observe(this.imgDiv, 'load',
|
||||
onload.bindAsEventListener(this));
|
||||
OpenLayers.Event.observe(this.imgDiv, 'load', onload.bind(this));
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -239,9 +239,9 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
if(delayDisplay) {
|
||||
image.style.display = "none";
|
||||
OpenLayers.Event.observe(image, "load",
|
||||
OpenLayers.Util.onImageLoad.bindAsEventListener(image));
|
||||
OpenLayers.Util.onImageLoad.bind(image));
|
||||
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) {
|
||||
img.style.display = "none";
|
||||
OpenLayers.Event.observe(img, "load",
|
||||
OpenLayers.Util.onImageLoad.bindAsEventListener(div));
|
||||
OpenLayers.Util.onImageLoad.bind(div));
|
||||
OpenLayers.Event.observe(img, "error",
|
||||
OpenLayers.Util.onImageLoadError.bindAsEventListener(div));
|
||||
OpenLayers.Util.onImageLoadError.bind(div));
|
||||
}
|
||||
|
||||
OpenLayers.Util.modifyAlphaImageDiv(div, id, px, sz, imgURL, position,
|
||||
|
||||
Reference in New Issue
Block a user