[OpenLayers-Commits] r3641 - trunk/openlayers/lib/OpenLayers/Handler

commits at openlayers.org commits at openlayers.org
Fri Jul 6 20:09:23 EDT 2007


Author: tschaub
Date: 2007-07-06 20:09:22 -0400 (Fri, 06 Jul 2007)
New Revision: 3641

Modified:
   trunk/openlayers/lib/OpenLayers/Handler/Drag.js
Log:
#812 - give drag handler a done callback

Modified: trunk/openlayers/lib/OpenLayers/Handler/Drag.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Drag.js	2007-07-06 23:09:47 UTC (rev 3640)
+++ trunk/openlayers/lib/OpenLayers/Handler/Drag.js	2007-07-07 00:09:22 UTC (rev 3641)
@@ -46,7 +46,10 @@
      * callbacks - {Object} An object containing a single function to be
      *                      called when the drag operation is finished.
      *                      The callback should expect to recieve a single
-     *                      argument, the point geometry.
+     *                      argument, the pixel location of the event.
+     *                      Callbacks for 'move' and 'done' are supported. 
+     *                      You can also speficy callbacks for 'down', 'up', 
+     *                      and 'out' to respond to those events.
      * options - {Object} 
      */
     initialize: function(control, callbacks, options) {
@@ -112,6 +115,7 @@
             // TBD replace with CSS classes
             this.map.div.style.cursor = "";
             this.callback("up", [evt.xy]);
+            this.callback("done", [evt.xy]);
             document.onselectstart = this.oldOnselectstart;
         }
         return true;
@@ -136,6 +140,7 @@
             if(document.onselectstart) {
                 document.onselectstart = this.oldOnselectstart;
             }
+            this.callback("done", [evt.xy])
         }
         return true;
     },



More information about the Commits mailing list