OpenLayers OpenLayers

Changeset 1316

Show
Ignore:
Timestamp:
08/19/06 11:57:14 (2 years ago)
Author:
crschmidt
Message:

Post-drag 'click' events aren't really clicks. Don't let them fall through to
the map.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/openlayers/2.0/lib/OpenLayers/Control/MouseToolbar.js

    r1315 r1316  
    3636        OpenLayers.Control.prototype.draw.apply(this, arguments); 
    3737        this.buttons = new Object(); 
     38        this.map.events.register( "click", this, this.defaultClick ); 
    3839        this.map.events.register( "dblclick", this, this.defaultDblClick ); 
    3940        this.map.events.register( "mousedown", this, this.defaultMouseDown ); 
     
    146147                this.measureBox.style.width="4px"; 
    147148                this.measureBox.style.height="4px"; 
     149                this.measureBox.style.fontSize = "1px"; 
    148150                this.measureBox.style.backgroundColor="red"; 
    149151                this.measureBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1; 
     
    268270                this.defaultMouseUp(evt); 
    269271        } 
     272    }, 
     273    defaultClick: function (evt) { 
     274        if (this.performedDrag)  { 
     275            this.performedDrag = false; 
     276            return false; 
     277        } 
    270278    } 
    271279});