roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2014 03:45:44 +0000 (11:45 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 10 Feb 2014 03:45:44 +0000 (11:45 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index 0da3c5a..854a451 100644 (file)
@@ -1102,7 +1102,7 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component,  {
                 b.xns = b.xns || Roo.bootstrap;
                 b.xtype = b.xtype || 'Button';
                 if (typeof(b.listeners) == 'undefined') {
-                    b.listeners = { click : function(b,e) { this.onButtonClick(b,e); } };
+                    b.listeners = { click : this.onButtonClick.createDelegate(this)  };
                 }
                 
                 var btn = Roo.factory(b);
index 4467957..8105191 100644 (file)
@@ -34,7 +34,7 @@ Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.c
 //Roo/bootstrap/Modal.js
 Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true});};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}
 this.el=Roo.get(document.body).createChild(B,A);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}
-this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);this.maskEl.enableDisplayMode("block");this.maskEl.hide();if(this.buttons){Roo.each(this.buttons,function(bb){b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button';if(typeof(b.listeners)=='undefined'){b.listeners={click:function(b,e){this.onButtonClick(b,e);}};}var C=Roo.factory(b);C.onRender(this.el.select('.modal-footer').first());},this);}
+this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);this.maskEl.enableDisplayMode("block");this.maskEl.hide();if(this.buttons){Roo.each(this.buttons,function(bb){b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button';if(typeof(b.listeners)=='undefined'){b.listeners={click:this.onButtonClick.createDelegate(this)};}var C=Roo.factory(b);C.onRender(this.el.select('.modal-footer').first());},this);}
 this.initEvents();},getAutoCreate:function(){var A={cls:'modal-body',html:this.html||''};return {cls:"modal fade",cn:[{cls:"modal-dialog",cn:[{cls:"modal-content",cn:[{cls:'modal-header',cn:[{tag:'button',cls:'close',html:'&times'},{tag:'h4',cls:'modal-title',html:this.title}]},A,{cls:'modal-footer'}]}]}]};},getChildContainer:function(){return this.el.select('.modal-body',true).first();},getButtonContainer:function(){return this.el.select('.modal-footer',true).first();},initEvents:function(){this.el.select('.modal-header .close').on('click',this.hide,this);},show:function(){if(!this.rendered){this.render();}
 this.el.addClass('on');this.el.removeClass('fade');this.el.setStyle('display','block');Roo.get(document.body).addClass("x-body-masked");this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.show();this.el.setStyle('zIndex','10001');},hide:function(){this.maskEl.hide();this.el.removeClass('on');this.el.addClass('fade');this.el.setStyle('display','none');},onButtonClick:function(A,e){this.fireEvent('btnclick',A.name,e);}});Roo.apply(Roo.bootstrap.Modal,{OK:[{name:'ok',weight:'primary',html:'OK'}],YESNO:[{name:'yes',weight:'primary',html:'Yes'},{name:'no',html:'No'}],OKCANCEL:[{name:'ok',weight:'primary',html:'OK'},{name:'cancel',html:'Cancel'}],YESNOCANCEL:[{name:'yes',weight:'primary',html:'Yes'},{name:'no',html:'No'},{name:'cancel',html:'Cancel'}]});
 //Roo/bootstrap/Navbar.js