From 478ea863f1772b068269a6043eb181805846a812 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 20 Aug 2013 16:48:33 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js --- roojs-ui-debug.js | 2 +- roojs-ui.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 6a418adbd8..b319b3ef27 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -27720,7 +27720,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype, { displayField: item.displayField ? item.displayField : 'val', valueField : 'val', typeAhead: false, - mode: 'local', + mode: typeof(tbc.stores[i]) != 'undefined' ? 'remote' : 'local', editable : false, triggerAction: 'all', emptyText:'Select', diff --git a/roojs-ui.js b/roojs-ui.js index f26c2fc2f4..43a5a6d463 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:'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'?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;} 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);} -- 2.39.2