From 85f736139b94db20b540d98522ab5a8e99a68171 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 10 Oct 2019 20:00:06 +0200 Subject: [PATCH] fix opening note revisions from the sidebar --- src/public/javascripts/dialogs/note_revisions.js | 12 +----------- src/public/javascripts/services/entrypoints.js | 13 +++++++++++++ src/public/javascripts/widgets/note_revisions.js | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/public/javascripts/dialogs/note_revisions.js b/src/public/javascripts/dialogs/note_revisions.js index 328c73402..783ff6a80 100644 --- a/src/public/javascripts/dialogs/note_revisions.js +++ b/src/public/javascripts/dialogs/note_revisions.js @@ -62,14 +62,4 @@ $list.on('change', () => { else { $content.text("Preview isn't available for this note type."); } -}); - -$(document).on('click', "a[data-action='note-revision']", event => { - const linkEl = $(event.target); - const noteId = linkEl.attr('data-note-path'); - const noteRevisionId = linkEl.attr('data-note-revision-id'); - - showNoteRevisionsDialog(noteId, noteRevisionId); - - return false; -}); +}); \ No newline at end of file diff --git a/src/public/javascripts/services/entrypoints.js b/src/public/javascripts/services/entrypoints.js index f285a0e22..11b9e17a4 100644 --- a/src/public/javascripts/services/entrypoints.js +++ b/src/public/javascripts/services/entrypoints.js @@ -172,6 +172,19 @@ function registerEntrypoints() { utils.bindGlobalShortcut('ctrl+-', zoomService.decreaseZoomFactor); utils.bindGlobalShortcut('ctrl+=', zoomService.increaseZoomFactor); } + + $(document).on('click', "a[data-action='note-revision']", async event => { + const linkEl = $(event.target); + const noteId = linkEl.attr('data-note-path'); + const noteRevisionId = linkEl.attr('data-note-revision-id'); + + const attributesDialog = await import("../dialogs/note_revisions.js"); + + attributesDialog.showNoteRevisionsDialog(noteId, noteRevisionId); + + return false; + }); + } export default { diff --git a/src/public/javascripts/widgets/note_revisions.js b/src/public/javascripts/widgets/note_revisions.js index 4d6f9016e..a8fd86179 100644 --- a/src/public/javascripts/widgets/note_revisions.js +++ b/src/public/javascripts/widgets/note_revisions.js @@ -20,7 +20,7 @@ class NoteRevisionsWidget extends StandardWidget { const $showFullButton = $("").append("show dialog").addClass('widget-header-action'); $showFullButton.click(async () => { const attributesDialog = await import("../dialogs/note_revisions.js"); - attributesDialog.showDialog(); + attributesDialog.showCurrentNoteRevisions(this.ctx.note.noteId); }); return [$showFullButton];