OpenLayers OpenLayers

Changeset 4100

Show
Ignore:
Timestamp:
08/29/07 00:21:17 (1 year ago)
Author:
crschmidt
Message:

Properly destroy OpenLayers.Handler.MouseWheel, patch from fredj. Added
tests for it as well. (Closes #935)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Handler/MouseWheel.js

    r4042 r4100  
    4747     */     
    4848    destroy: function() { 
    49         this.deactivate(); 
     49        OpenLayers.Handler.prototype.destroy.apply(this, arguments); 
    5050        this.wheelListener = null; 
    51         OpenLayers.Handler.prototype.destroy.apply(this, arguments); 
    5251    }, 
    5352 
  • trunk/openlayers/tests/Handler/test_MouseWheel.html

    r4083 r4100  
    118118             "deactivate returns true if the handler was active already"); 
    119119    } 
     120    function test_handler_MouseWheel_destroy(t) { 
     121        t.plan(1); 
     122        var control = new OpenLayers.Control(); 
     123        var handler = new OpenLayers.Handler.MouseWheel(control); 
     124        handler.deactivate = function() {  
     125            t.ok(true, "Deactivate called one time."); 
     126        }     
     127        handler.destroy(); 
     128    } 
    120129 
    121130