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, {
50 getAutoCreate : function()
54 cls : 'roo-document-viewer',
58 cls : 'roo-document-viewer-body',
62 cls : 'roo-document-viewer-thumb',
66 cls : 'roo-document-viewer-image'
74 cls : 'roo-document-viewer-footer',
77 cls : 'btn-group btn-group-justified roo-document-viewer-btn-group',
85 cls : 'btn btn-default roo-document-viewer-trash',
86 html : '<i class="fa fa-trash"></i>'
99 initEvents : function()
102 this.bodyEl = this.el.select('.roo-document-viewer-body', true).first();
103 this.bodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
105 this.thumbEl = this.el.select('.roo-document-viewer-thumb', true).first();
106 this.thumbEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
108 this.imageEl = this.el.select('.roo-document-viewer-image', true).first();
109 this.imageEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
111 this.footerEl = this.el.select('.roo-document-viewer-footer', true).first();
112 this.footerEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
114 this.trashBtn = this.el.select('.roo-document-viewer-trash', true).first();
115 this.trashBtn.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay = 'block';
117 this.bodyEl.on('click', this.onClick, this);
119 this.trashBtn.on('click', this.onTrash, this);
125 // this.thumbEl.setStyle('line-height', this.thumbEl.getHeight(true) + 'px');
128 this.fireEvent('initial', this);
132 onClick : function(e)
136 this.fireEvent('click', this);
139 onTrash : function(e)
143 this.fireEvent('trash', this);