* @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
* @param {Roo.bootstrap.Modal} this
* @param {Roo.EventObject} e
*/
- "resize" : true
+ "resize" : true,
+ /**
+ * @event close
+ * Fire when the top 'x' close button is pressed.
+ * @param {Roo.bootstrap.Modal} this
+ * @param {Roo.EventObject} e
+ */
+ "close" : true
});
this.buttons = this.buttons || [];
var btn = Roo.factory(b);
- btn.render(this.el.select('.modal-footer div').first());
+ btn.render(this.getButtonContainer());
},this);
}
} :
{ // BS4 uses mr-auto on left buttons....
- cls : 'modal-footer',
- }
+ cls : 'modal-footer'
+ };
cn : header
},
bdy,
- {
- cls : 'modal-footer',
- cn : [
- {
- tag: 'div',
- cls: 'btn-' + this.buttonPosition
- }
- ]
-
- }
-
-
+ footer
]
}
},
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()
{
if (this.allow_close) {
- this.closeEl.on('click', this.hide, this);
+ this.closeEl.on('click', this.onClosePress, this);
}
Roo.EventManager.onWindowResize(this.resize, this, true);
+ },
+
+ onClosePress : function()
+ {
+
},
resize : function()
var btn = Roo.factory(b);
- btn.render(this.el.select('.modal-footer div').first());
+ btn.render(this.getButtonContainer());
return btn;