From: Alan Knowles Date: Fri, 30 Nov 2018 03:48:49 +0000 (+0800) Subject: Roo/bootstrap/Modal.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=700224870cf6aa1ea0b725c1c037c659fddd570d Roo/bootstrap/Modal.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/Roo/bootstrap/Modal.js b/Roo/bootstrap/Modal.js index 89444bb9e8..dc46682926 100644 --- a/Roo/bootstrap/Modal.js +++ b/Roo/bootstrap/Modal.js @@ -219,8 +219,8 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { } : { // BS4 uses mr-auto on left buttons.... - cls : 'modal-footer', - } + cls : 'modal-footer' + }; diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 77cbd3d921..694a823590 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -2642,7 +2642,7 @@ Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component, { * @cfg {Roo.Template} tmpl - a template with variables. to use it, add a handler in show:method adn * @cfg {Boolean} specificTitle default false * @cfg {Array} buttons Array of buttons or standard button set.. - * @cfg {String} buttonPosition (left|right|center) default right + * @cfg {String} buttonPosition (left|right|center) default right (DEPRICATED) - use mr-auto on buttons to put them on the left * @cfg {Boolean} animate default true * @cfg {Boolean} allow_close default true * @cfg {Boolean} fitwindow default false @@ -2836,7 +2836,26 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { if(this.size.length){ size = 'modal-' + this.size; } + + var footer = Roo.bootstrap.version == 3 ? + { + cls : 'modal-footer', + cn : [ + { + tag: 'div', + cls: 'btn-' + this.buttonPosition + } + ] + } : + { // BS4 uses mr-auto on left buttons.... + cls : 'modal-footer' + }; + + + + + var modal = { cls: "modal", cn : [ @@ -2885,7 +2904,10 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { }, getButtonContainer : function() { - return this.el.select('.modal-footer div',true).first(); + + return Roo.bootstrap.version == 4 ? + this.el.select('.modal-footer',true).first() + : this.el.select('.modal-footer div',true).first(); }, initEvents : function() diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 90da3cc5ea..2a0e71d323 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -115,11 +115,12 @@ this.footerEl=this.el.select('.modal-footer',true).first();this.maskEl=Roo.DomHe if(typeof(b.listeners)=='undefined'){b.listeners={click:this.onButtonClick.createDelegate(this)};}var E=Roo.factory(b);E.render(this.el.select('.modal-footer div').first());},this);}var C=[];if(typeof(this.items)!='undefined'){var D=this.items;delete this.items; for(var i=0;i