1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00

Fix viewer in Nextcloud 17 and up

This commit is contained in:
e-alfred 2019-11-24 20:16:48 +01:00 committed by GitHub
parent d12f915b51
commit 0678c795e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,30 +73,9 @@
*/
show: function(downloadUrl, mimeType, isFileList) {
var self = this;
var $iframe;
var viewer = OC.generateUrl('/apps/files_reader/?file={file}&type={type}', {file: downloadUrl, type: mimeType});
// launch in new window on mobile and touch devices...
if (isMobile || hasTouch) {
window.open(viewer, downloadUrl);
} else {
$iframe = '<iframe style="width:100%;height:100%;display:block;position:absolute;top:0;" src="' + viewer + '" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" sandbox="allow-scripts allow-same-origin"/>';
if (isFileList === true) {
FileList.setViewerMode(true);
}
if ($('#isPublic').val()) {
// force the preview to adjust its height
$('#preview').append($iframe).css({ height: '100%' });
$('body').css({ height: '100%' });
$('footer').addClass('hidden');
$('#imgframe').addClass('hidden');
$('.directLink').addClass('hidden');
$('.directDownload').addClass('hidden');
$('#controls').addClass('hidden');
} else {
$('#app-content').append($iframe);
self.hideControls();
}
}
window.open(viewer, downloadUrl);
},
/**