7 * @class Roo.bootstrap.DocumentViewer
8 * @extends Roo.bootstrap.Component
9 * Bootstrap DocumentViewer class
10 * @cfg {Number} width default 300
11 * @cfg {Number} height 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, {
37 getAutoCreate : function()
41 cls : 'roo-document-viewer',
45 cls : 'roo-document-viewer-body',
49 cls : 'roo-document-viewer-preview',
50 style : 'width: ' + this.width + 'px; height: ' + this.height + 'px;',
54 cls : 'roo-document-viewer-thumb'
62 cls : 'roo-document-viewer-footer',
65 cls : 'btn-group btn-group-justified roo-document-viewer-btn-group',
73 cls : 'btn btn-default roo-document-viewer-trash',
74 html : '<i class="fa fa-trash"></i>'
87 initEvents : function()
90 this.bodyEl = this.el.select('.roo-document-viewer-body', true).first();
91 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
93 this.previewEl = this.el.select('.roo-document-viewer-preview', true).first();
94 this.previewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
96 this.thumbEl = this.el.select('.roo-document-viewer-thumb', true).first();
97 this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
99 this.footerEl = this.el.select('.roo-document-viewer-footer', true).first();
100 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
102 this.trashBtn = this.el.select('.roo-document-viewer-trash', true).first();
103 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
105 this.bodyEl.on('click', this.onClick, this);
107 this.trashBtn.on('click', this.onTrash, this);
109 this.fireEvent('initial', this);