this.footDisp.dom.style.overflow='hidden';this.footDisp.dom.innerHTML=B;},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();
});},buildToolbar:function(A,nm,B){var C=this.editor;var D=this.editorcore;var E=C.wrap.createChild({tag:'div'},C.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(E);tb.hasStyles=false;tb.name=nm;tb.add((typeof(B)=='undefined'?nm:B)+": ");
var F=Array.from(this.styles);if(F&&F.length){tb.hasStyles=true;tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val','selected'],data:[]}),name:'-roo-edit-className',attrname:'className',displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select Style',selectOnFocus:true,width:130,listeners:{'select':function(c,r,i){tb.selectedNode.className=r?r.get('val'):'';
-D.syncValue();}}}));}var G=Roo.form.HtmlEditor.ToolbarContext;for(var i in A){if(typeof(A[i].xtype)!='undefined'){tb.addField(Roo.factory(A[i].xtype));continue;}var H=A[i];tb.add(H.title+": ");var I=H.opts?H.opts:false;if(H.optname){I=Roo.form.HtmlEditor.ToolbarContext.options[H.optname];
+D.syncValue();}}}));}var G=Roo.form.HtmlEditor.ToolbarContext;for(var i in A){if(typeof(A[i].xtype)!='undefined'){tb.addField(Roo.factory(A[i]));continue;}var H=A[i];tb.add(H.title+": ");var I=H.opts?H.opts:false;if(H.optname){I=Roo.form.HtmlEditor.ToolbarContext.options[H.optname];
}if(I){tb.addField(new Roo.form.ComboBox({store:typeof(G.stores[i])!='undefined'?Roo.factory(G.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:I}),name:'-roo-edit-'+i,attrname:i,stylename:H.style?H.style:false,displayField:H.displayField?H.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(G.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:H.width?H.width:130,listeners:{'select':function(c,r,i){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
b[c.attrname]=r.get('val');b.updateElement(tb.selectedNode);D.syncValue();return;}if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');D.syncValue();return;}if(r===false){tb.selectedNode.removeAttribute(c.attrname);D.syncValue();return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));
D.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:H.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
// newer versions will use xtype cfg to create menus.
if (typeof(tlist[i].xtype) != 'undefined') {
- tb.addField(Roo.factory(tlist[i].xtype));
+ tb.addField(Roo.factory(tlist[i]));
continue;
}
// newer versions will use xtype cfg to create menus.
if (typeof(tlist[i].xtype) != 'undefined') {
- tb.addField(Roo.factory(tlist[i].xtype));
+ tb.addField(Roo.factory(tlist[i]));
continue;
}
this.footDisp.dom.style.overflow='hidden';this.footDisp.dom.innerHTML=B;},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();
});},buildToolbar:function(A,nm,B){var C=this.editor;var D=this.editorcore;var E=C.wrap.createChild({tag:'div'},C.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(E);tb.hasStyles=false;tb.name=nm;tb.add((typeof(B)=='undefined'?nm:B)+": ");
var F=Array.from(this.styles);if(F&&F.length){tb.hasStyles=true;tb.addField(new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'val',fields:['val','selected'],data:[]}),name:'-roo-edit-className',attrname:'className',displayField:'val',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Select Style',selectOnFocus:true,width:130,listeners:{'select':function(c,r,i){tb.selectedNode.className=r?r.get('val'):'';
-D.syncValue();}}}));}var G=Roo.form.HtmlEditor.ToolbarContext;for(var i in A){if(typeof(A[i].xtype)!='undefined'){tb.addField(Roo.factory(A[i].xtype));continue;}var H=A[i];tb.add(H.title+": ");var I=H.opts?H.opts:false;if(H.optname){I=Roo.form.HtmlEditor.ToolbarContext.options[H.optname];
+D.syncValue();}}}));}var G=Roo.form.HtmlEditor.ToolbarContext;for(var i in A){if(typeof(A[i].xtype)!='undefined'){tb.addField(Roo.factory(A[i]));continue;}var H=A[i];tb.add(H.title+": ");var I=H.opts?H.opts:false;if(H.optname){I=Roo.form.HtmlEditor.ToolbarContext.options[H.optname];
}if(I){tb.addField(new Roo.form.ComboBox({store:typeof(G.stores[i])!='undefined'?Roo.factory(G.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:I}),name:'-roo-edit-'+i,attrname:i,stylename:H.style?H.style:false,displayField:H.displayField?H.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(G.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:H.width?H.width:130,listeners:{'select':function(c,r,i){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);
b[c.attrname]=r.get('val');b.updateElement(tb.selectedNode);D.syncValue();return;}if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');D.syncValue();return;}if(r===false){tb.selectedNode.removeAttribute(c.attrname);D.syncValue();return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));
D.syncValue();}}}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:H.width,value:'',listeners:{'change':function(f,nv,ov){if(tb.selectedNode.hasAttribute('data-block')){var b=Roo.htmleditor.Block.factory(tb.selectedNode);