OpenLayers OpenLayers

Ticket #827: drag.3.patch

File drag.3.patch, 1.1 kB (added by euzuro, 1 year ago)

the rewrite of the activate/deactivate code that was in there as part of this patch I think is good. i've reenacted it here... if others like this, we should put it in. also, if we want to move those functions up to the beginning of the file, we can do that too (without making a ticket)

  • lib/OpenLayers/Handler/Drag.js

    old new  
    210210     * {Boolean} The handler was successfully activated. 
    211211     */ 
    212212    activate: function() { 
     213        var activated = false; 
    213214        if(OpenLayers.Handler.prototype.activate.apply(this, arguments)) { 
    214215            this.dragging = false; 
    215             return true; 
    216         } else { 
    217             return false; 
    218         } 
     216            activated = true; 
     217        }  
     218        return activated; 
    219219    }, 
    220220 
    221221    /** 
     
    226226     * {Boolean} The handler was successfully deactivated. 
    227227     */ 
    228228    deactivate: function() { 
     229        var deactivated = false; 
    229230        if(OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) { 
    230231            this.dragging = false; 
    231             return true; 
    232         } else { 
    233             return false; 
    234         } 
     232            deactivated = true; 
     233        }  
     234        return deactivated; 
    235235    }, 
    236236 
    237237    CLASS_NAME: "OpenLayers.Handler.Drag"