callback for close button on popup (closes #1061)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4916 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -117,9 +117,10 @@ OpenLayers.Popup = OpenLayers.Class({
|
||||
* contentHTML - {String} The HTML content to display inside the
|
||||
* popup.
|
||||
* closeBox - {Boolean} Whether to display a close box inside
|
||||
* the popup.
|
||||
* the popup.
|
||||
* closeBoxCallback - {Function} Function to be called on closeBox click.
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, closeBox) {
|
||||
initialize:function(id, lonlat, size, contentHTML, closeBox, closeBoxCallback) {
|
||||
if (id == null) {
|
||||
id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
|
||||
}
|
||||
@@ -165,7 +166,7 @@ OpenLayers.Popup = OpenLayers.Class({
|
||||
closeImg.style.top = this.padding + "px";
|
||||
this.groupDiv.appendChild(closeImg);
|
||||
|
||||
var closePopup = function(e) {
|
||||
var closePopup = closeBoxCallback || function(e) {
|
||||
this.hide();
|
||||
OpenLayers.Event.stop(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user