roojs-ui.js
authorAlan Knowles <alan@roojs.com>
Tue, 20 Aug 2013 08:53:28 +0000 (16:53 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 20 Aug 2013 08:53:28 +0000 (16:53 +0800)
roojs-ui-debug.js

roojs-ui-debug.js
roojs-ui.js

index b319b3e..71a76df 100644 (file)
@@ -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  
index 43a5a6d..7ae5907 100644 (file)
@@ -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?' &gt; ':'';I+='<span class="x-ed-loc-'+i+'">'+a.tagName+'</span>';});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+":&nbsp;");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+":&nbsp;");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+":&nbsp;");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+":&nbsp;");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);}