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.

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.
  • Loading branch information
akhanfir committed Nov 13, 2024
1 parent 06363ce commit 99b5388
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 99b5388

Please sign in to comment.