X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=d0da6a2875916733f416b063c353b0b2d4065043;hp=6dff3ac4d007d487f980d936493e6c6b6553f8ef;hb=c3fae677247c171d616820f63a06609c27abacb3;hpb=fe420d2446bbf077df23ab1ce3159fe2cd786415 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 6dff3ac4d0..d0da6a2875 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -29817,7 +29817,10 @@ Roo.apply(Roo.bootstrap.LocationPicker, { * @cfg {String} title The title of alert * @cfg {String} html The content of alert * @cfg {String} weight ( success | info | warning | danger ) - * @cfg {String} faicon font-awesomeicon + * @cfg {String} fa font-awesomeicon + * @cfg {Number} seconds default:-1 Number of seconds until it disapears (-1 means never.) + * @cfg {Boolean} close true to show a x closer + * * * @constructor * Create a new alert @@ -29835,7 +29838,10 @@ Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component, { title: '', html: '', weight: false, - faicon: false, + fa: false, + faicon: false, // BC + close : false, + getAutoCreate : function() { @@ -29844,6 +29850,13 @@ Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component, { tag : 'div', cls : 'alert', cn : [ + { + tag: 'button', + type : "button", + cls: "close", + html : '×', + style : this.close ? '' : 'display:none' + }, { tag : 'i', cls : 'roo-alert-icon' @@ -29865,6 +29878,9 @@ Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component, { if(this.faicon){ cfg.cn[0].cls += ' fa ' + this.faicon; } + if(this.fa){ + cfg.cn[0].cls += ' fa ' + this.fa; + } if(this.weight){ cfg.cls += ' alert-' + this.weight; @@ -29876,38 +29892,43 @@ Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component, { initEvents: function() { this.el.setVisibilityMode(Roo.Element.DISPLAY); + this.titleEl = this.el.select('.roo-alert-title',true).first(); + this.iconEl = this.el.select('.roo-alert-icon',true).first(); + if (this.seconds > 0) { + this.hide.defer(this.seconds, this); + } }, setTitle : function(str) { - this.el.select('.roo-alert-title',true).first().dom.innerHTML = str; + this.titleEl.dom.innerHTML = str; }, setText : function(str) { - this.el.select('.roo-alert-text',true).first().dom.innerHTML = str; + this.titleEl.dom.innerHTML = str; }, setWeight : function(weight) { if(this.weight){ - this.el.select('.alert',true).first().removeClass('alert-' + this.weight); + this.el.removeClass('alert-' + this.weight); } this.weight = weight; - this.el.select('.alert',true).first().addClass('alert-' + this.weight); + this.el.addClass('alert-' + this.weight); }, setIcon : function(icon) { if(this.faicon){ - this.el.select('.roo-alert-icon',true).first().removeClass(['fa', 'fa-' + this.faicon]); + this.alertEl.removeClass(['fa', 'fa-' + this.faicon]); } this.faicon = icon; - this.el.select('.roo-alert-icon',true).first().addClass(['fa', 'fa-' + this.faicon]); + this.alertEl.addClass(['fa', 'fa-' + this.faicon]); }, hide: function()