7 * @class Roo.bootstrap.DocumentViewer
8 * @extends Roo.bootstrap.Component
9 * Bootstrap DocumentViewer class
10 * @cfg {Boolean} showDownload (true|false) show download button (default true)
11 * @cfg {Boolean} showTrash (true|false) show trash button (default true)
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
31 * @param {Roo.bootstrap.DocumentViewer} this
36 * Fire after trash button
37 * @param {Roo.bootstrap.DocumentViewer} this
44 Roo.extend(Roo.bootstrap.DocumentViewer, Roo.bootstrap.Component, {
46 getAutoCreate : function()
50 cls : 'roo-document-viewer',
54 cls : 'roo-document-viewer-body',
58 cls : 'roo-document-viewer-thumb',
62 cls : 'roo-document-viewer-image'
70 cls : 'roo-document-viewer-footer',
73 cls : 'btn-group btn-group-justified roo-document-viewer-btn-group',
81 cls : 'btn btn-default roo-document-viewer-trash',
82 html : '<i class="fa fa-trash"></i>'
95 initEvents : function()
98 this.bodyEl = this.el.select('.roo-document-viewer-body', true).first();
99 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
101 this.thumbEl = this.el.select('.roo-document-viewer-thumb', true).first();
102 this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
104 this.imageEl = this.el.select('.roo-document-viewer-image', true).first();
105 this.imageEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
107 this.footerEl = this.el.select('.roo-document-viewer-footer', true).first();
108 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
110 this.trashBtn = this.el.select('.roo-document-viewer-trash', true).first();
111 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
113 this.bodyEl.on('click', this.onClick, this);
115 this.trashBtn.on('click', this.onTrash, this);
121 // this.thumbEl.setStyle('line-height', this.thumbEl.getHeight(true) + 'px');
124 this.fireEvent('initial', this);
128 onClick : function(e)
132 this.fireEvent('click', this);
135 onTrash : function(e)
139 this.fireEvent('trash', this);