7 * @class Roo.bootstrap.DocumentViewer
8 * @extends Roo.bootstrap.Component
9 * Bootstrap DocumentViewer class
10 * @cfg {Number} thumbWidth default 300
11 * @cfg {Number} thumbHeight default 300
14 * Create a new DocumentViewer
15 * @param {Object} config The config object
18 Roo.bootstrap.DocumentViewer = function(config){
19 Roo.bootstrap.DocumentViewer.superclass.constructor.call(this, config);
24 * Fire after initEvent
25 * @param {Roo.bootstrap.DocumentViewer} this
32 Roo.extend(Roo.bootstrap.DocumentViewer, Roo.bootstrap.Component, {
38 getAutoCreate : function()
42 cls : 'roo-document-viewer',
46 cls : 'roo-document-viewer-body',
50 cls : 'roo-document-viewer-thumb',
51 style : 'width: ' + this.thumbWidth + 'px; height: ' + this.thumbHeight + 'px;',
57 cls : 'roo-document-viewer-footer',
60 cls : 'btn-group btn-group-justified roo-document-viewer-btn-group',
68 cls : 'btn btn-default roo-document-viewer-trash',
69 html : '<i class="fa fa-trash"></i>'
82 initEvents : function()
85 this.bodyEl = this.el.select('.roo-document-viewer-body', true).first();
86 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
88 this.thumbEl = this.el.select('.roo-document-viewer-thumb', true).first();
89 this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
91 this.footerEl = this.el.select('.roo-document-viewer-footer', true).first();
92 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
94 this.trashBtn = this.el.select('.roo-document-viewer-trash', true).first();
95 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
97 this.bodyEl.on('click', this.onClick, this);
99 this.trashBtn.on('click', this.onTrash, this);
101 this.fireEvent('initial', this);
108 this.thumbEl.setStyle('background-image', 'url("' + baseURL +'/Images/Thumb/' + this.thumbWidth + '/' + file.id + '/' + file.filename + '")');