From 99b538867771f767cf0b977c2d9c9d1a7d64677e Mon Sep 17 00:00:00 2001 From: Anwar khanfir Date: Wed, 13 Nov 2024 09:08:11 +0100 Subject: [PATCH] fix: Edit button displayed twice in a shared file preview mode - EXO-74839. Before this change, when open link of shared file in a new tab, two edit buttons are displayed in the opened preview page. To resolve this problem, make a condition on the edit button insertion to ensure that it is inserted only once. After this change, only one edit button is displayed and no reload page. --- .../src/main/webapp/javascript/eXo/ecm/document-preview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/resources-wcm/src/main/webapp/javascript/eXo/ecm/document-preview.js b/apps/resources-wcm/src/main/webapp/javascript/eXo/ecm/document-preview.js index 77cb15df5df..36cd984acf0 100644 --- a/apps/resources-wcm/src/main/webapp/javascript/eXo/ecm/document-preview.js +++ b/apps/resources-wcm/src/main/webapp/javascript/eXo/ecm/document-preview.js @@ -637,7 +637,9 @@ if(!this.isDownloadStatusActivated && !documentPreview.defaultSettings.doc.isCloudDrive) { var editorButtonsLoader = editorbuttons.initPreviewButtons(this.settings.doc.id, this.settings.doc.workspace, 'dropup'); editorButtonsLoader.done(function ($buttonsContainer) { - $(".previewBtn").append($buttonsContainer); + if ($(".previewBtn").find('.editorButtonContainer').length === 0){ + $(".previewBtn").append($buttonsContainer); + } }); }