From 584fea19921aa1a2c5911f4b977c642755625264 Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 12 Mar 2021 20:44:19 +0100 Subject: [PATCH] Revert "delete notes skeleton dialog" This reverts commit 03a11e6f --- src/public/app/dialogs/delete_notes.js | 54 -------------------------- src/public/app/services/branches.js | 9 +++-- src/views/desktop.ejs | 1 - src/views/dialogs/delete_notes.ejs | 23 ----------- 4 files changed, 5 insertions(+), 82 deletions(-) delete mode 100644 src/public/app/dialogs/delete_notes.js delete mode 100644 src/views/dialogs/delete_notes.ejs diff --git a/src/public/app/dialogs/delete_notes.js b/src/public/app/dialogs/delete_notes.js deleted file mode 100644 index 35eb880f5..000000000 --- a/src/public/app/dialogs/delete_notes.js +++ /dev/null @@ -1,54 +0,0 @@ -const $dialog = $("#delete-notes-dialog"); -const $confirmContent = $("#delete-notes-dialog-content"); -const $okButton = $("#delete-notes-dialog-ok-button"); -const $cancelButton = $("#delete-notes-dialog-cancel-button"); -const $custom = $("#delete-notes-dialog-custom"); - -const DELETE_NOTE_BUTTON_ID = "delete-notes-dialog-delete-note"; - -let $originallyFocused; // element focused before the dialog was opened so we can return to it afterwards - -export function showDialog(message) { - $originallyFocused = $(':focus'); - - $custom.hide(); - - glob.activeDialog = $dialog; - - if (typeof message === 'string') { - message = $("
").text(message); - } - - $confirmContent.empty().append(message); - - $dialog.modal(); - - return new Promise((res, rej) => { resolve = res; }); -} - -export function isDeleteNoteChecked() { - return $("#" + DELETE_NOTE_BUTTON_ID + ":checked").length > 0; -} - -$dialog.on('shown.bs.modal', () => $okButton.trigger("focus")); - -$dialog.on("hidden.bs.modal", () => { - if (resolve) { - resolve(false); - } - - if ($originallyFocused) { - $originallyFocused.trigger('focus'); - $originallyFocused = null; - } -}); - -function doResolve(ret) { - resolve(ret); - resolve = null; - - $dialog.modal("hide"); -} - -$cancelButton.on('click', () => doResolve(false)); -$okButton.on('click', () => doResolve(true)); diff --git a/src/public/app/services/branches.js b/src/public/app/services/branches.js index 8f368626b..0ae9c0a96 100644 --- a/src/public/app/services/branches.js +++ b/src/public/app/services/branches.js @@ -74,9 +74,6 @@ async function deleteNotes(branchIdsToDelete) { return false; } - const deleteNotesDialog = await import("../dialogs/delete_notes.js"); - deleteNotesDialog.showDialog(); - const $deleteClonesCheckbox = $('
') .append($('')) .append($('