we want to keep a reference to the close div in our popups if we make it. (Closes #1334)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6048 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+13
-8
@@ -90,6 +90,12 @@ OpenLayers.Popup = OpenLayers.Class({
|
|||||||
*/
|
*/
|
||||||
groupDiv: null,
|
groupDiv: null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Property: closeDiv
|
||||||
|
* {DOMElement} the optional closer image
|
||||||
|
*/
|
||||||
|
closeDiv: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: padding
|
* Property: padding
|
||||||
* {int} the internal padding of the content div.
|
* {int} the internal padding of the content div.
|
||||||
@@ -157,19 +163,18 @@ OpenLayers.Popup = OpenLayers.Class({
|
|||||||
// close icon
|
// close icon
|
||||||
var closeSize = new OpenLayers.Size(17,17);
|
var closeSize = new OpenLayers.Size(17,17);
|
||||||
var img = OpenLayers.Util.getImagesLocation() + "close.gif";
|
var img = OpenLayers.Util.getImagesLocation() + "close.gif";
|
||||||
var closeImg = OpenLayers.Util.createAlphaImageDiv(this.id + "_close",
|
this.closeDiv = OpenLayers.Util.createAlphaImageDiv(
|
||||||
null,
|
this.id + "_close", null, closeSize, img
|
||||||
closeSize,
|
);
|
||||||
img);
|
this.closeDiv.style.right = this.padding + "px";
|
||||||
closeImg.style.right = this.padding + "px";
|
this.closeDiv.style.top = this.padding + "px";
|
||||||
closeImg.style.top = this.padding + "px";
|
this.groupDiv.appendChild(this.closeDiv);
|
||||||
this.groupDiv.appendChild(closeImg);
|
|
||||||
|
|
||||||
var closePopup = closeBoxCallback || function(e) {
|
var closePopup = closeBoxCallback || function(e) {
|
||||||
this.hide();
|
this.hide();
|
||||||
OpenLayers.Event.stop(e);
|
OpenLayers.Event.stop(e);
|
||||||
};
|
};
|
||||||
OpenLayers.Event.observe(closeImg, "click",
|
OpenLayers.Event.observe(this.closeDiv, "click",
|
||||||
OpenLayers.Function.bindAsEventListener(closePopup, this));
|
OpenLayers.Function.bindAsEventListener(closePopup, this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user