[OpenLayers-Commits] r11808 - in trunk/openlayers: lib/OpenLayers/Handler tests/Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Mar 30 16:54:45 EDT 2011


Author: tschaub
Date: 2011-03-30 13:54:41 -0700 (Wed, 30 Mar 2011)
New Revision: 11808

Modified:
   trunk/openlayers/lib/OpenLayers/Handler/Drag.js
   trunk/openlayers/tests/Handler/Drag.html
Log:
Restore drag handler state in deactivate. r=erilem (closes #3218)

Modified: trunk/openlayers/lib/OpenLayers/Handler/Drag.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Drag.js	2011-03-30 20:53:46 UTC (rev 11807)
+++ trunk/openlayers/lib/OpenLayers/Handler/Drag.js	2011-03-30 20:54:41 UTC (rev 11808)
@@ -145,6 +145,7 @@
             };
         }
     },
+
     
     /**
      * Method: dragstart
@@ -507,6 +508,7 @@
     deactivate: function() {
         var deactivated = false;
         if(OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
+            this.touch = false;
             this.started = false;
             this.dragging = false;
             this.start = null;

Modified: trunk/openlayers/tests/Handler/Drag.html
===================================================================
--- trunk/openlayers/tests/Handler/Drag.html	2011-03-30 20:53:46 UTC (rev 11807)
+++ trunk/openlayers/tests/Handler/Drag.html	2011-03-30 20:54:41 UTC (rev 11808)
@@ -416,7 +416,7 @@
     }
 
     function test_Handler_Drag_deactivate(t) {
-        t.plan(6);
+        t.plan(7);
         var map = new OpenLayers.Map('map');
         var control = new OpenLayers.Control();
         map.addControl(control);
@@ -427,6 +427,7 @@
              "deactivate returns false if the handler was not already active");
         handler.active = true;
         handler.dragging = true;
+        handler.touch = true;
         deactivated = handler.deactivate();
         t.ok(deactivated,
              "deactivate returns true if the handler was active already");
@@ -437,7 +438,9 @@
         t.ok(handler.start == null,
              "deactivate sets start to null");
         t.ok(handler.last == null,
-             "deactivate sets start to null");
+             "deactivate sets last to null");
+        t.ok(!handler.touch,
+             "deactivate sets touch to false");
     }
 
     function test_interval_timer_after_mouseup(t) {



More information about the Commits mailing list