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)
12 * @cfg {Boolean} clickToDownload (true|false) click to download (default true)
15 * Create a new DocumentViewer
16 * @param {Object} config The config object
19 Roo.bootstrap.DocumentViewer = function(config){
20 Roo.bootstrap.DocumentViewer.superclass.constructor.call(this, config);
25 * Fire after initEvent
26 * @param {Roo.bootstrap.DocumentViewer} this
32 * @param {Roo.bootstrap.DocumentViewer} this
37 * Fire after trash button
38 * @param {Roo.bootstrap.DocumentViewer} this
45 Roo.extend(Roo.bootstrap.DocumentViewer, Roo.bootstrap.Component, {
51 getAutoCreate : function()
55 cls : 'roo-document-viewer',
59 cls : 'roo-document-viewer-body',
63 cls : 'roo-document-viewer-thumb',
67 cls : 'roo-document-viewer-image'
75 cls : 'roo-document-viewer-footer',
78 cls : 'btn-group btn-group-justified roo-document-viewer-btn-group',
86 cls : 'btn btn-default roo-document-viewer-trash',
87 html : '<i class="fa fa-trash"></i>'
100 initEvents : function()
103 this.bodyEl = this.el.select('.roo-document-viewer-body', true).first();
104 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
106 this.thumbEl = this.el.select('.roo-document-viewer-thumb', true).first();
107 this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
109 this.imageEl = this.el.select('.roo-document-viewer-image', true).first();
110 this.imageEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
112 this.footerEl = this.el.select('.roo-document-viewer-footer', true).first();
113 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
115 this.trashBtn = this.el.select('.roo-document-viewer-trash', true).first();
116 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
118 this.bodyEl.on('click', this.onClick, this);
120 this.trashBtn.on('click', this.onTrash, this);
126 // this.thumbEl.setStyle('line-height', this.thumbEl.getHeight(true) + 'px');
129 this.fireEvent('initial', this);
133 onClick : function(e)
137 this.fireEvent('click', this);
140 onTrash : function(e)
144 this.fireEvent('trash', this);