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                 }
63             ]
64         };
65         
66         return cfg;
67     },
68     
69     initEvents : function()
70     {
71         this.bodyEl = this.el.select('.roo-document-slider-body', true).first();
72         this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY);
73         
74         this.thumbEl = this.el.select('.roo-document-slider-thumb', true).first();
75         this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY);
76         
77         this.imageEl = this.el.select('.roo-document-slider-image', true).first();
78         this.imageEl.setVisibilityMode(Roo.Element.DISPLAY);
79     },
80     
81     initial : function()
82     {
83         this.fireEvent('initial', this);
84     }
85 });