OpenLayers OpenLayers

Ticket #555: popupEvents.patch

File popupEvents.patch, 0.7 kB (added by euzuro, 2 years ago)

this fixes the problem, though im a little offput by the fact that the only way to do this is by subverting the OpenLayers.Event object system. It seems like there should be a better way to do this -- that this bug is indicative of a greater probrlem with the Openlayers.Event class itself.

  • lib/OpenLayers/Popup.js

    old new  
    104104            closeImg.style.top = this.padding + "px"; 
    105105            this.div.appendChild(closeImg); 
    106106 
    107             var closeEvents = new OpenLayers.Events(this, closeImg); 
    108             closeEvents.register("mousedown", this, this.hide); 
     107            var closePopup = function(e) { 
     108                this.hide(); 
     109                OpenLayers.Event.stop(e); 
     110            } 
     111            OpenLayers.Event.observe(closeImg, "click",  
     112                                     closePopup.bindAsEventListener(this)); 
    109113 
    110114        } 
    111115