Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: C:/ms4w/Apache/htdocs/keilavesi/lib/OpenLayers/Handler/Drag.js
- ===================================================================
- --- C:/ms4w/Apache/htdocs/keilavesi/lib/OpenLayers/Handler/Drag.js (revision 600)
- +++ C:/ms4w/Apache/htdocs/keilavesi/lib/OpenLayers/Handler/Drag.js (working copy)
- @@ -189,6 +189,10 @@
- var propagate = true;
- this.dragging = false;
- if (this.checkModifiers(evt) && OpenLayers.Event.isLeftClick(evt)) {
- + this.downEvt = OpenLayers.Util.extend({}, evt);
- + delete this.downEvt.preventDefault;
- + delete this.downEvt.stopPropagation;
- +
- this.started = true;
- this.start = evt.xy;
- this.last = evt.xy;
- @@ -269,6 +273,7 @@
- * {Boolean} Let the event propagate.
- */
- mouseup: function (evt) {
- + var propagate = true;
- if (this.started) {
- if(this.documentDrag === true && this.documentEvents) {
- this.adjustXY(evt);
- @@ -284,12 +289,29 @@
- this.callback("up", [evt.xy]);
- if(dragged) {
- this.callback("done", [evt.xy]);
- + } else {
- + this.replayClickSequence();
- + propagate = false;
- }
- document.onselectstart = this.oldOnselectstart;
- }
- - return true;
- + return propagate;
- },
- + replayClickSequence: function() {
- + this.map.events.injectEventLower(this.downEvt.type, this.downEvt, this);
- +
- + var upEvt = OpenLayers.Util.extend({}, this.downEvt);
- + upEvt.type = 'mouseup';
- + this.map.events.injectEventLower(upEvt.type, upEvt, this);
- +
- + var clickEvt = OpenLayers.Util.extend({}, this.downEvt);
- + clickEvt.type = 'click';
- + this.map.events.injectEventLower(clickEvt.type, clickEvt, this);
- +
- + this.downEvt = null;
- + },
- +
- /**
- * Method: mouseout
- * Handle mouseout events
- @@ -301,6 +323,7 @@
- * {Boolean} Let the event propagate.
- */
- mouseout: function (evt) {
- + var propagate = true;
- if (this.started && OpenLayers.Util.mouseLeft(evt, this.map.div)) {
- if(this.documentDrag === true) {
- this.documentEvents = new OpenLayers.Events(this, document,
- @@ -323,13 +346,16 @@
- this.callback("out", []);
- if(dragged) {
- this.callback("done", [evt.xy]);
- + } else {
- + this.replayClickSequence();
- + propagate = false;
- }
- if(document.onselectstart) {
- document.onselectstart = this.oldOnselectstart;
- }
- }
- }
- - return true;
- + return propagate;
- },
- /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement