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/attribute_renderer.js b/src/public/app/services/attribute_renderer.js index 5212536d2..08120e754 100644 --- a/src/public/app/services/attribute_renderer.js +++ b/src/public/app/services/attribute_renderer.js @@ -79,6 +79,15 @@ async function renderAttributes(attributes, renderIsInheritable) { return $container; } +const HIDDEN_ATTRIBUTES = [ + 'originalFileName', + 'template', + 'cssClass', + 'iconClass', + 'pageSize', + 'viewType' +]; + async function renderNormalAttributes(note) { const promotedDefinitionAttributes = note.getPromotedDefinitionAttributes(); let attrs = note.getAttributes(); @@ -90,6 +99,7 @@ async function renderNormalAttributes(note) { attrs = attrs.filter( attr => !attr.isDefinition() && !attr.isAutoLink + && !HIDDEN_ATTRIBUTES.includes(attr.name) && attr.noteId === note.noteId ); } 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($('