Roo/bootstrap/Alert.js
[roojs1] / Roo / bootstrap / Alert.js
1 /*
2  * - LGPL
3  *
4  * Alert
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.Alert
10  * @extends Roo.bootstrap.Component
11  * Bootstrap Alert class
12  * @cfg {String} title The title of alert
13  * @cfg {String} html The content of alert
14  * @cfg {String} weight (  success | info | warning | danger )
15  * @cfg {String} faicon font-awesomeicon
16  * 
17  * @constructor
18  * Create a new alert
19  * @param {Object} config The config object
20  */
21
22
23 Roo.bootstrap.Alert = function(config){
24     Roo.bootstrap.Alert.superclass.constructor.call(this, config);
25     
26 };
27
28 Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component,  {
29     
30     title: '',
31     html: '',
32     weight: '',
33     faicon: '',
34     
35     getAutoCreate : function()
36     {
37         
38         var cfg = {
39             tag : 'div',
40             cls : 'alert',
41             cn : []
42         };
43         
44         return cfg;
45     },
46     
47     initEvents: function() 
48     {
49         
50     },
51     
52     setText : function(str)
53     {
54         this.el.select('.roo-button-text',true).first().dom.innerHTML = str;
55     },
56     
57     hide: function() 
58     {
59         this.el.hide();   
60     },
61     
62     show: function() 
63     {  
64         this.el.show();   
65     }
66     
67 });
68
69