Count form elements rather than tab children
authorRichard Fairhurst <richard@systemeD.net>
Mon, 5 Mar 2012 00:30:25 +0000 (00:30 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 5 Mar 2012 00:30:25 +0000 (00:30 +0000)
net/systemeD/potlatch2/TagViewer.mxml

index 3a1cc38..5756ab5 100644 (file)
                if (form.parent.width>0) form.maxWidth=form.parent.width;
        }
 
-      private function ensureEditorsPopulated(tab:VBox):void {
-          var components:Array = tabComponents[tab];
-          if ( components == null || tab == null || tab.numChildren >= components.length )
-              return;
-          for each (var component:DisplayObject in components ) {
-              Form(tab.getChildByName("form")).addElement(UIComponent(component));
-          }
-      }
+       private function ensureEditorsPopulated(tab:VBox):void {
+               var components:Array = tabComponents[tab];
+               var form:Form=Form(tab.getChildByName("form"));
+               if ( components == null || tab == null || form.numElements >= components.length ) return;
+               for each (var component:DisplayObject in components ) {
+                       form.addElement(UIComponent(component));
+               }
+       }
 
        private function initEditorStackUIs():void {
                editorStackTabNavigator = new TabNavigator();