Skip to content

Commit

Permalink
fix: Edit button displayed twice in a shared file preview mode - EXO-…
Browse files Browse the repository at this point in the history
…74839. (#2427)

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.

(cherry picked from commit 0e622c9)
  • Loading branch information
akhanfir authored and Jihed525 committed Nov 13, 2024
1 parent 98a3208 commit 97a3f67
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}

Expand Down

0 comments on commit 97a3f67

Please sign in to comment.