Minor reworking of the merge button layout, which also allows the visibility to work...
authorAndy Allan <andy@gravitystorm.co.uk>
Mon, 4 Jul 2011 15:03:17 +0000 (16:03 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Mon, 4 Jul 2011 15:03:17 +0000 (16:03 +0100)
net/systemeD/potlatch2/panels/BackgroundMergePanel.mxml

index 64450c0a0f7648249264194bac7d1224b85c921c..9833a5e963dd46935434185a3aa8cf24e3bc271b 100644 (file)
     <mx:columns>
       <mx:DataGridColumn editable="false" dataField="k" headerText="Key" />
       <mx:DataGridColumn editable="false" dataField="e" headerText="OSM value" />
-      <mx:DataGridColumn editable="false" headerText="Merge" width="30">
+      <mx:DataGridColumn editable="false" headerText="Merge" width="50" textAlign="center">
         <mx:itemRenderer>
           <mx:Component>
-            <mx:Button label="&lt;&lt;" visible="{data.b == null}" click="trace('b is '+data.b);parentDocument.mergeForKey(data.k);" />
+            <mx:HBox horizontalAlign="center" verticalAlign="middle">
+              <mx:Button label="&lt;&lt;" visible="{parentDocument.buttonVisible(data.b, data.e)}" click="parentDocument.mergeForKey(data.k);" />
+            </mx:HBox>
           </mx:Component>
         </mx:itemRenderer>
       </mx:DataGridColumn>
           }
       }
 
+      public function buttonVisible(b:String, e:String):Boolean {
+          if (b != null && b != e) {
+              return true;
+          }
+          return false;
+      }
+
       public function mergeForKey(key:String):void {
           trace("merge for " + key);
       }