Roo/form/HtmlEditor/ToolbarContext.js
authorAlan Knowles <alan@akbkhome.com>
Wed, 18 Apr 2012 08:04:13 +0000 (16:04 +0800)
committerAlan Knowles <alan@akbkhome.com>
Wed, 18 Apr 2012 08:04:13 +0000 (16:04 +0800)
Roo/form/HtmlEditor/ToolbarContext.js

index 49cef43..ab6816a 100644 (file)
@@ -344,7 +344,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
             // update attributes
             if (this.tb.fields) {
                 this.tb.fields.each(function(e) {
-                   e.setValue(sel.getAttribute(e.name));
+                   e.setValue(sel.getAttribute(e.attrname));
                 });
             }
             
@@ -469,6 +469,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                     data : [] 
                 }),
                 name : '-roo-edit-className',
+                attrname : 'className',
                 displayField:'val',
                 typeAhead: false,
                 mode: 'local',
@@ -507,6 +508,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                         data : item.opts  
                     }),
                     name : '-roo-edit-' + i,
+                    attrname : i,
                     displayField:'val',
                     typeAhead: false,
                     mode: 'local',
@@ -517,7 +519,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                     width: item.width ? item.width  : 130,
                     listeners : {
                         'select': function(c, r, i) {
-                            tb.selectedNode.setAttribute(c.name, r.get('val'));
+                            tb.selectedNode.setAttribute(c.attrname, r.get('val'));
                         }
                     }
 
@@ -535,13 +537,15 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
                 continue;
             }
             tb.addField( new Roo.form.TextField({
-                name: i,
+                name: '-roo-edit-' + i,
+                attrname : i,
+                
                 width: item.width,
                 //allowBlank:true,
                 value: '',
                 listeners: {
                     'change' : function(f, nv, ov) {
-                        tb.selectedNode.setAttribute(f.name, nv);
+                        tb.selectedNode.setAttribute(f.attrname, nv);
                     }
                 }
             }));