Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_pdfviewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-01-16 22:44:36 +0300
committerJulius Härtl <jus@bitgrid.net>2018-01-18 13:16:35 +0300
commit97770f2cb9e546920c4481b7d7e1fc82390513e5 (patch)
tree64362d332b3f47a7b0bee87a0eed15dc50b87067
parent20c5f217816fb9eff19596fa90fccc470608c446 (diff)
Fix duplicate iframe id
The duplicate id caused issues when closing the pdf preview while the sidebar was visible. In that case two DOM elements with the same id were present and the click event handler was registered to the wrong element. Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--js/previewplugin.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/previewplugin.js b/js/previewplugin.js
index ed5ce6f..80afafb 100644
--- a/js/previewplugin.js
+++ b/js/previewplugin.js
@@ -155,7 +155,7 @@ $(document).ready(function(){
var downloadUrl = Files.getDownloadUrl(model.get('name'), model.get('path'));
var viewer = OC.generateUrl('/apps/files_pdfviewer/?minmode=true&file={file}', {file: downloadUrl});
- var $iframe = $('<iframe id="pdframe" style="width:100%;height:' + previewHeight + 'px;display:block;" src="' + viewer + '" sandbox="allow-scripts allow-same-origin allow-popups allow-modals" />');
+ var $iframe = $('<iframe id="pdframe-sidebar" style="width:100%;height:' + previewHeight + 'px;display:block;" src="' + viewer + '" sandbox="allow-scripts allow-same-origin allow-popups allow-modals" />');
$thumbnailDiv.append($iframe);
$iframe.on('load', function() {