[OpenLayers-Commits] r5099 - in trunk/openlayers: lib/OpenLayers/Control tests/Control

commits at openlayers.org commits at openlayers.org
Thu Nov 1 19:06:12 EDT 2007


Author: tschaub
Date: 2007-11-01 19:06:10 -0400 (Thu, 01 Nov 2007)
New Revision: 5099

Modified:
   trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js
   trunk/openlayers/tests/Control/test_ModifyFeature.html
Log:
Dissalow vertex deletion while dragging - thanks for the review crschmidt (closes #1122).

Modified: trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js	2007-11-01 21:14:52 UTC (rev 5098)
+++ trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js	2007-11-01 23:06:10 UTC (rev 5099)
@@ -384,7 +384,8 @@
            OpenLayers.Util.indexOf(this.deleteCodes, code) != -1) {
             var vertex = this.dragControl.feature;
             if(vertex &&
-               OpenLayers.Util.indexOf(this.vertices, vertex) != -1) {
+               OpenLayers.Util.indexOf(this.vertices, vertex) != -1 &&
+               !this.dragControl.dragHandler.dragging) {
                 // remove the vertex
                 vertex.geometry.parent.removeComponent(vertex.geometry);
                 this.layer.drawFeature(this.feature,

Modified: trunk/openlayers/tests/Control/test_ModifyFeature.html
===================================================================
--- trunk/openlayers/tests/Control/test_ModifyFeature.html	2007-11-01 21:14:52 UTC (rev 5098)
+++ trunk/openlayers/tests/Control/test_ModifyFeature.html	2007-11-01 23:06:10 UTC (rev 5099)
@@ -168,6 +168,11 @@
         // run the above four tests twice
         control.handleKeypress(delKey);
         control.handleKeypress(dKey);
+
+        // now make sure nothing happens if the vertex is mid-drag
+        control.dragControl.dragHandler.dragging = true;
+        control.handleKeypress(delKey);
+
         // reset modified methods
         control.onModification = function() {};
         



More information about the Commits mailing list