update toolbox when reversing a way, or when adding nodes during drawway
authorAndy Allan <gravitystorm@gmail.com>
Wed, 26 Jan 2011 12:06:13 +0000 (12:06 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Wed, 26 Jan 2011 12:06:13 +0000 (12:06 +0000)
TODO.txt
net/systemeD/potlatch2/controller/DrawWay.as
net/systemeD/potlatch2/controller/SelectedWay.as

index 3a8e61f..feda0c1 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -70,7 +70,6 @@ Potlatch 2: main outstanding issues
 
 == Reverse Button ==
 * Doesn't look like a button
-* Clicking reverse doesn't update the toolbox (toolbox only recalculates itself on selection)
 * clockwise / anticlockwise are backwards
 
 Requested enhancements
index e9f78ca..b568fd7 100644 (file)
@@ -48,6 +48,7 @@ package net.systemeD.potlatch2.controller {
                     controller.map.setPurgable([node], false);
                                        resetElastic(node);
                                        lastClick=node;
+                                       controller.updateSelectionUI();
                                } else if ( entity is Node ) {
                                        if (entity==lastClick && (new Date().getTime()-lastClickTime.getTime())<1000) {
                                                if (Way(firstSelected).length==1 && Way(firstSelected).getNode(0).parentWays.length==1) {
index 2940fb1..17fc768 100644 (file)
@@ -40,6 +40,11 @@ package net.systemeD.potlatch2.controller {
             selection = [way];
             controller.updateSelectionUI();
             initWay = way;
+            way.addEventListener(Connection.WAY_REORDERED, updateSelectionUI, false, 0, true);
+        }
+
+        private function updateSelectionUI(e:Event):void {
+            controller.updateSelectionUI();
         }
 
         /** Tidy up UI as we transition to a new state without the current selection. */