From: Alan Knowles Date: Tue, 20 Aug 2013 08:53:28 +0000 (+0800) Subject: roojs-ui.js X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=c6a2042b5df31d237999612bce2ee36523458ae5;p=roojs1 roojs-ui.js roojs-ui-debug.js --- diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index b319b3ef27..71a76df7e6 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -27709,7 +27709,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype, { if (opts) { // opts == pulldown.. tb.addField( new Roo.form.ComboBox({ - store: typeof(tbc.stores[i]) != 'undefined' ? tbc.stores[i] : new Roo.data.SimpleStore({ + store: typeof(tbc.stores[i]) != 'undefined' ? Roo.factory(tbc.stores[i],Roo.data) : new Roo.data.SimpleStore({ id : 'val', fields: ['val', 'display'], data : opts diff --git a/roojs-ui.js b/roojs-ui.js index 43a5a6d463..7ae59077d8 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -601,7 +601,7 @@ this.tb.selectedNode=B;if((this.tb.name!=tn)||(F!=this.tb.selectedNode)){this.tb st.store.loadData(H);st.collapse();st.setValue(cn);} this.tb.selectedNode=B;Roo.menu.MenuMgr.hideAll();}if(!D){return;}var I='';this.footerEls=E.reverse();Roo.each(this.footerEls,function(a,i){if(!a){return;} I+=I.length?' > ':'';I+=''+a.tagName+'';});var sz=this.footDisp.up('td').getSize();this.footDisp.dom.style.width=(sz.width-10)+'px';this.footDisp.dom.style.marginLeft='5px';this.footDisp.dom.style.overflow='hidden';this.footDisp.dom.innerHTML=I;},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){var B=this.editor;var C=B.wrap.createChild({tag:'div'},B.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(C);tb.add(nm+": ");var D=[];for(var i in this.styles){D.push(i);}if(D&&D.length){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'):'';B.syncValue();}}}));}var E=Roo.form.HtmlEditor.ToolbarContext;var F=E.options;for(var i in A){var G=A[i];tb.add(G.title+": ");var H=G.opts?G.opts:false;if(G.optname){H=F[G.optname];}if(H){tb.addField(new Roo.form.ComboBox({store:typeof(E.stores[i])!='undefined'?E.stores[i]:new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:H}),name:'-roo-edit-'+i,attrname:i,stylename:G.style?G.style:false,displayField:G.displayField?G.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(E.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:G.width?G.width:130,listeners:{'select':function(c,r,i){if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');return;} +A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});},buildToolbar:function(A,nm){var B=this.editor;var C=B.wrap.createChild({tag:'div'},B.wrap.dom.firstChild.nextSibling,true);var tb=new Roo.Toolbar(C);tb.add(nm+": ");var D=[];for(var i in this.styles){D.push(i);}if(D&&D.length){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'):'';B.syncValue();}}}));}var E=Roo.form.HtmlEditor.ToolbarContext;var F=E.options;for(var i in A){var G=A[i];tb.add(G.title+": ");var H=G.opts?G.opts:false;if(G.optname){H=F[G.optname];}if(H){tb.addField(new Roo.form.ComboBox({store:typeof(E.stores[i])!='undefined'?Roo.factory(E.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:H}),name:'-roo-edit-'+i,attrname:i,stylename:G.style?G.style:false,displayField:G.displayField?G.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(E.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:G.width?G.width:130,listeners:{'select':function(c,r,i){if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val');return;} tb.selectedNode.setAttribute(c.attrname,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;} tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:G.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.attrname,nv);}}}));} tb.addFill();var I=this;tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode;var pn=sn.parentNode;var J=sn.childNodes[0];var en=sn.childNodes[sn.childNodes.length-1];while(sn.childNodes.length){var K=sn.childNodes[0];sn.removeChild(K);pn.insertBefore(K,sn);}