fix for #624 - merge stop() and safeStopPropagation()

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2994 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2007-04-03 17:15:57 +00:00
parent 10b5c2df17
commit 23131012dd
3 changed files with 44 additions and 20 deletions
+21 -7
View File
@@ -296,11 +296,9 @@ OpenLayers.Popup.prototype = {
this.events.register("mousedown", this, this.onmousedown);
this.events.register("mousemove", this, this.onmousemove);
this.events.register("mouseup", this, this.onmouseup);
this.events.register("click", this,
OpenLayers.Util.safeStopPropagation);
this.events.register("click", this, this.onclick);
this.events.register("mouseout", this, this.onmouseout);
this.events.register("dblclick", this,
OpenLayers.Util.safeStopPropagation);
this.events.register("dblclick", this, this.ondblclick);
},
/** When mouse goes down within the popup, make a note of
@@ -311,7 +309,7 @@ OpenLayers.Popup.prototype = {
*/
onmousedown: function (evt) {
this.mousedown = true;
OpenLayers.Util.safeStopPropagation(evt);
OpenLayers.Event.stop(evt, true);
},
/** If the drag was started within the popup, then
@@ -322,7 +320,7 @@ OpenLayers.Popup.prototype = {
*/
onmousemove: function (evt) {
if (this.mousedown) {
OpenLayers.Util.safeStopPropagation(evt);
OpenLayers.Event.stop(evt, true);
}
},
@@ -336,10 +334,18 @@ OpenLayers.Popup.prototype = {
onmouseup: function (evt) {
if (this.mousedown) {
this.mousedown = false;
OpenLayers.Util.safeStopPropagation(evt);
OpenLayers.Event.stop(evt, true);
}
},
/** Ignore clicks, but allowing default browser handling
*
* @param {Event} evt
*/
onclick: function (evt) {
OpenLayers.Event.stop(evt, true);
},
/** When mouse goes out of the popup set the flag to false so that
* if they let go and then drag back in, we won't be confused.
*
@@ -351,6 +357,14 @@ OpenLayers.Popup.prototype = {
this.mousedown = false;
},
/** Ignore double-clicks, but allowing default browser handling
*
* @param {Event} evt
*/
ondblclick: function (evt) {
OpenLayers.Event.stop(evt, true);
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Popup"
};