Roo/bootstrap/DocumentSlider.js
[roojs1] / Roo / bootstrap / DocumentSlider.js
1
2 /*
3 * Licence: LGPL
4 */
5
6 /**
7  * @class Roo.bootstrap.DocumentSlider
8  * @extends Roo.bootstrap.Component
9  * Bootstrap DocumentSlider class
10  * 
11  * @constructor
12  * Create a new DocumentViewer
13  * @param {Object} config The config object
14  */
15
16 Roo.bootstrap.DocumentSlider = function(config){
17     Roo.bootstrap.DocumentSlider.superclass.constructor.call(this, config);
18     
19     this.addEvents({
20         /**
21          * @event initial
22          * Fire after initEvent
23          * @param {Roo.bootstrap.DocumentViewer} this
24          */
25         "initial" : true
26     });
27 };
28
29 Roo.extend(Roo.bootstrap.DocumentSlider, Roo.bootstrap.Component,  {
30     
31     getAutoCreate : function()
32     {
33         var cfg = {
34             tag : 'div',
35             cls : 'roo-document-slider',
36             cn : [
37                 {
38                     tag : 'div',
39                     cls : 'roo-document-slider-body',
40                     cn : [
41                         {
42                             tag : 'div',
43                             cls : 'roo-document-slider-prev',
44                             cn : [
45                                 {
46                                     tag : 'i',
47                                     cls : 'fa fa-chevron-left'
48                                 }
49                             ]
50                         },
51                         {
52                             tag : 'div',
53                             cls : 'roo-document-slider-thumb',
54                             cn : [
55                                 {
56                                     tag : 'img',
57                                     cls : 'roo-document-slider-image'
58                                 }
59                             ]
60                         },
61                         {
62                             tag : 'div',
63                             cls : 'roo-document-slider-next',
64                             cn : [
65                                 {
66                                     tag : 'i',
67                                     cls : 'fa fa-chevron-right'
68                                 }
69                             ]
70                         }
71                     ]
72                 }
73             ]
74         };
75         
76         return cfg;
77     },
78     
79     initEvents : function()
80     {
81         this.bodyEl = this.el.select('.roo-document-slider-body', true).first();
82         this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY);
83         
84         this.thumbEl = this.el.select('.roo-document-slider-thumb', true).first();
85         this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY);
86         
87         this.imageEl = this.el.select('.roo-document-slider-image', true).first();
88         this.imageEl.setVisibilityMode(Roo.Element.DISPLAY);
89     },
90     
91     initial : function()
92     {
93         this.fireEvent('initial', this);
94     }
95 });