remove debugging code
[roojs1] / Roo / bootstrap / dash / NumberBox.js
1 /*
2  * - LGPL
3  *
4  * numberBox
5  * 
6  */
7 Roo.bootstrap.dash = Roo.bootstrap.dash || {};
8
9 /**
10  * @class Roo.bootstrap.dash.NumberBox
11  * @extends Roo.bootstrap.Component
12  * Bootstrap NumberBox class
13  * @cfg {String} headline Box headline
14  * @cfg {String} content Box content
15  * @cfg {String} icon Box icon
16  * @cfg {String} footer Footer text
17  * @cfg {String} fhref Footer href
18  * 
19  * @constructor
20  * Create a new NumberBox
21  * @param {Object} config The config object
22  */
23
24
25 Roo.bootstrap.dash.NumberBox = function(config){
26     Roo.bootstrap.dash.NumberBox.superclass.constructor.call(this, config);
27     
28 };
29
30 Roo.extend(Roo.bootstrap.dash.NumberBox, Roo.bootstrap.Component,  {
31     
32     headline : '',
33     content : '',
34     icon : '',
35     footer : '',
36     fhref : '',
37     ficon : '',
38     
39     getAutoCreate : function(){
40         
41         var cfg = {
42             tag : 'div',
43             cls : 'small-box ',
44             cn : [
45                 {
46                     tag : 'div',
47                     cls : 'inner',
48                     cn :[
49                         {
50                             tag : 'h3',
51                             cls : 'roo-headline',
52                             html : this.headline
53                         },
54                         {
55                             tag : 'p',
56                             cls : 'roo-content',
57                             html : this.content
58                         }
59                     ]
60                 }
61             ]
62         };
63         
64         if(this.icon){
65             cfg.cn.push({
66                 tag : 'div',
67                 cls : 'icon',
68                 cn :[
69                     {
70                         tag : 'i',
71                         cls : 'ion ' + this.icon
72                     }
73                 ]
74             });
75         }
76         
77         if(this.footer){
78             var footer = {
79                 tag : 'a',
80                 cls : 'small-box-footer',
81                 href : this.fhref || '#',
82                 html : this.footer
83             };
84             
85             cfg.cn.push(footer);
86             
87         }
88         
89         return  cfg;
90     },
91
92     onRender : function(ct,position){
93         Roo.bootstrap.dash.NumberBox.superclass.onRender.call(this,ct,position);
94
95
96        
97                 
98     },
99
100     setHeadline: function (value)
101     {
102         this.el.select('.roo-headline',true).first().dom.innerHTML = value;
103     },
104     
105     setFooter: function (value, href)
106     {
107         this.el.select('a.small-box-footer',true).first().dom.innerHTML = value;
108         
109         if(href){
110             this.el.select('a.small-box-footer',true).first().attr('href', href);
111         }
112         
113     },
114
115     setContent: function (value)
116     {
117         this.el.select('.roo-content',true).first().dom.innerHTML = value;
118     },
119
120     initEvents: function() 
121     {   
122         
123     }
124     
125 });
126
127