Roo/bootstrap/Modal.js
authorEdward <edward@roojs.com>
Fri, 21 Mar 2014 13:11:52 +0000 (21:11 +0800)
committerEdward <edward@roojs.com>
Fri, 21 Mar 2014 13:11:52 +0000 (21:11 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/Modal.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 53912f3..784c625 100644 (file)
@@ -39,7 +39,6 @@
 
 Roo.bootstrap.Modal = function(config){
     Roo.bootstrap.Modal.superclass.constructor.call(this, config);
-    this.el = Roo.get(document.body);
     this.addEvents({
         // raw events
         /**
index e28d1a0..a4c7d78 100644 (file)
@@ -1110,7 +1110,6 @@ Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component,  {
 
 Roo.bootstrap.Modal = function(config){
     Roo.bootstrap.Modal.superclass.constructor.call(this, config);
-    this.el = Roo.get(document.body);
     this.addEvents({
         // raw events
         /**
index 0f8e02e..324ba1a 100644 (file)
@@ -31,7 +31,7 @@ Roo.bootstrap.MenuItem=function(A){Roo.bootstrap.MenuItem.superclass.constructor
 //Roo/bootstrap/MenuSeparator.js
 Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuSeparator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={cls:'divider',tag:'li'};return A;}});
 //Roo/bootstrap/Modal.js
-Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.el=Roo.get(document.body);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;}
+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: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(){Roo.log(this);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();}