Roo/form/HtmlEditor/ToolbarContext.js
authorAlan Knowles <alan@roojs.com>
Wed, 31 Aug 2011 04:44:40 +0000 (12:44 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 31 Aug 2011 04:44:40 +0000 (12:44 +0800)
Roo/form/HtmlEditor/ToolbarContext.js

index 35fbec7..5ee69c1 100644 (file)
@@ -308,6 +308,14 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
             // update name
             this.tb.items.first().el.innerHTML = tn + ':&nbsp;';
             
+            
+            // update attributes
+            if (this.tb.fields) {
+                this.tb.fields.each(function(e) {
+                   e.setValue(sel.getAttribute(e.name));
+                });
+            }
+            
             // update styles
             var st = this.tb.fields.item(0);
             st.store.removeAll();
@@ -328,13 +336,9 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
             
             st.store.loadData(avs);
             st.collapse();
+            st.setValue()
             
-            // update attributes
-            if (this.tb.fields) {
-                this.tb.fields.each(function(e) {
-                   e.setValue(sel.getAttribute(e.name));
-                });
-            }
+            // flag our selected Node.
             this.tb.selectedNode = sel;