7 * @class Roo.bootstrap.DocumentViewer
8 * @extends Roo.bootstrap.Component
9 * Bootstrap DocumentViewer class
12 * Create a new DocumentViewer
13 * @param {Object} config The config object
16 Roo.bootstrap.DocumentViewer = function(config){
17 Roo.bootstrap.DocumentViewer.superclass.constructor.call(this, config);
22 * Fire after initEvent
23 * @param {Roo.bootstrap.DocumentViewer} this
29 * @param {Roo.bootstrap.DocumentViewer} this
34 * Fire after trash button
35 * @param {Roo.bootstrap.DocumentViewer} this
42 Roo.extend(Roo.bootstrap.DocumentViewer, Roo.bootstrap.Component, {
44 getAutoCreate : function()
48 cls : 'roo-document-viewer',
52 cls : 'roo-document-viewer-body',
56 cls : 'roo-document-viewer-thumb',
60 cls : 'roo-document-viewer-image'
68 cls : 'roo-document-viewer-footer',
71 cls : 'btn-group btn-group-justified roo-document-viewer-btn-group',
79 cls : 'btn btn-default roo-document-viewer-trash',
80 html : '<i class="fa fa-trash"></i>'
93 initEvents : function()
96 this.bodyEl = this.el.select('.roo-document-viewer-body', true).first();
97 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
99 this.thumbEl = this.el.select('.roo-document-viewer-thumb', true).first();
100 this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
102 this.imageEl = this.el.select('.roo-document-viewer-image', true).first();
103 this.imageEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
105 this.footerEl = this.el.select('.roo-document-viewer-footer', true).first();
106 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
108 this.trashBtn = this.el.select('.roo-document-viewer-trash', true).first();
109 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
111 this.bodyEl.on('click', this.onClick, this);
113 this.trashBtn.on('click', this.onTrash, this);
119 this.thumbEl.setStyle('line-height', this.thumbEl.getHeight(true) + 'px');
121 this.fireEvent('initial', this);
125 onClick : function(e)
129 this.fireEvent('click', this);
132 onTrash : function(e)
136 this.fireEvent('trash', this);