OpenLayers OpenLayers

Changeset 5685

Show
Ignore:
Timestamp:
01/08/08 12:34:34 (1 year ago)
Author:
tschaub
Message:

Removing methods copied from the drag handler.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/tests/Handler/test_Click.html

    r5438 r5685  
    230230    } 
    231231 
    232     function test_Handler_Drag_submethods(t) { 
    233         t.plan(4); 
    234          
    235         var map = new OpenLayers.Map('map', {controls: []}); 
    236  
    237         var control = new OpenLayers.Control(); 
    238         map.addControl(control); 
    239          
    240  
    241         var handler = new OpenLayers.Handler.Drag(control, {}); 
    242         // set test events 
    243         var events = ["down", "move", "up", "out"]; 
    244         var testEvents = {}; 
    245         var type, px; 
    246         for(var i=0; i<events.length; ++i) { 
    247             type = events[i]; 
    248             px = new OpenLayers.Pixel(Math.random(), Math.random()); 
    249             testEvents[type] = {xy: px}; 
    250             setMethod(type); 
    251         } 
    252         function setMethod(type) { 
    253             handler[type] = function(evt) { 
    254                 t.ok(evt.xy.x == testEvents[type].xy.x && 
    255                      evt.xy.y == testEvents[type].xy.y, 
    256                      "handler." + type + " called with the right event"); 
    257             } 
    258         } 
    259         handler.activate(); 
    260          
    261         // test mousedown 
    262         handler.checkModifiers = function(evt) { 
    263             return true; 
    264         } 
    265         var oldIsLeftClick = OpenLayers.Event.isLeftClick; 
    266         OpenLayers.Event.isLeftClick = function(evt) { 
    267             return true; 
    268         } 
    269         map.events.triggerEvent("mousedown", testEvents.down); 
    270         OpenLayers.Event.isLeftClick = oldIsLeftClick; 
    271  
    272         // test mousemove 
    273         map.events.triggerEvent("mousemove", testEvents.move); 
    274          
    275         // test mouseup 
    276         map.events.triggerEvent("mouseup", testEvents.up); 
    277          
    278         // test mouseout 
    279         var oldMouseLeft = OpenLayers.Util.mouseLeft; 
    280         OpenLayers.Util.mouseLeft = function() { 
    281             return true; 
    282         }; 
    283         handler.started = true; 
    284         map.events.triggerEvent("mouseout", testEvents.out); 
    285         OpenLayers.Util.mouseLeft = oldMouseLeft; 
    286          
    287     } 
    288  
    289232    function test_Handler_Click_deactivate(t) { 
    290233        t.plan(4);