Merge remote-tracking branch 'gravitystorm/form-layout' into form-layout
[potlatch2.git] / net / systemeD / potlatch2 / TagViewer.mxml
index 8d4f7fb36b4e7517a2689fc26b8f20d53ed219d0..693bc6569cc53801775f2228a658517d1c946667 100644 (file)
@@ -1,4 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!---
+  The TagViewer is the container for the entire sidebar. It has a number of components, and subpanels, in a ViewStack that change
+  depending on what is selected, i.e. the ControllerState.
+
+  @see net.systemeD.potlatch2.controller.ControllerState
+    -->
 <mx:VBox
     xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library://ns.adobe.com/flex/mx"
@@ -32,6 +38,8 @@
                                                        import mx.core.DragSource;
 
                                                        private function dragPOI(event:MouseEvent, tags:Array):void {
+                                                               if (outerDocument.controller.map.dragstate==outerDocument.controller.map.DRAGGING) return;
+
                                                                // Get the drag initiator component from the event object.
                                                                var dragInitiator:Image = event.currentTarget as Image;
                                                                var dragSource:DragSource = new DragSource();
               markerPanelContents.init(selectedEntity, layer);
               sidebar.selectedChild = markerPanel;
             } else if (connection is SnapshotConnection) {
-              backgroundPanelContents.init(selectedEntity, layer);
+              backgroundPanelContents.init(selectedEntity);
               sidebar.selectedChild = backgroundPanel;
             } else {
               refreshFeatureIcon();
                        if      ( entity is Node     ) entityText = "Node";
                        else if ( entity is Way      ) entityText = "Way";
                        else if ( entity is Relation ) entityText = "Relation";
-                       advancedID.htmlText = entityText+": <b>"+entity.id+"</b>";
+                       advancedID.htmlText = entityText+": <b>"+entity.id+"</b> "+(entity.status ? entity.status : '');
                }
 
                removeRelationListeners();
       }
 
          public function addNewTag():void {
-               if (stack.selectedChild!=advancedContainer) { return; }
-               advancedTagGrid.addNewTag();
+               if (sidebar.selectedChild==multiplePanel) { multiAdvancedTagGrid.addNewTag(); }
+               else if (stack.selectedChild==advancedContainer) { advancedTagGrid.addNewTag(); }
          }
 
       private function addedToRelation(event:RelationMemberEvent):void {