I am trying to resolve an issue where it takes multiple clicks to close a pop-up.
I capture the PopUp closed event, so that I can update a DataGridView in another UpdatePanel. However, when I closes the first PopUp, it takes one click to close; when I close the second PopUp it takes 2 clicks to close; when I close the fifth PopUp it takes 5 clicks to close, and so on.
Currently, my javascript code looks like below. If I comment out the doPostBack line, then all PopUps close with one click.
Any suggestions?
var Map;function OnMapCreated(map) {Map = map;if (map.popups.length > 0) {OpenLayers.Event.stopObservingElement(map.popups[0].closeDiv, “click”, OpenLayers.Function.bindAsEventListener(function () { this.hide(); }, map.popups[0]));OpenLayers.Event.observe(map.popups[0].closeDiv, “click”, OpenLayers.Function.bindAsEventListener(closeCallBack, map.popups[0]));OpenLayers.Event.observe(map.popups[0].closeDiv, “touchend”, OpenLayers.Function.bindAsEventListener(closeCallBack, map.popups[0]));}function closeCallBack() {Map.popups[0].hide();__doPostBack(’<%=UpdatePanelExceptionsGridView.ClientID %>’, “PopupClosed”);this.hide();}