Implement closing the current, and all, documents from the menu bar (#265)

Closes #261
Additional cleanup and refactoring with the way the backend relays the list of open documents to the frontend and prompts for confirmation.
This commit is contained in:
Keavon Chambers
2021-07-14 16:13:58 -07:00
parent f7e5dd1a4f
commit ccea88dfd7
9 changed files with 148 additions and 75 deletions

View File

@@ -83,8 +83,8 @@ const menuEntries: MenuListEntries = [
},
],
[
{ label: "Close", shortcut: ["Ctrl", "W"] },
{ label: "Close All", shortcut: ["Ctrl", "Alt", "W"] },
{ label: "Close", shortcut: ["Ctrl", "W"], action: async () => (await wasm).close_active_document_with_confirmation() },
{ label: "Close All", shortcut: ["Ctrl", "Alt", "W"], action: async () => (await wasm).close_all_documents_with_confirmation() },
],
[
{ label: "Save", shortcut: ["Ctrl", "S"] },
@@ -154,6 +154,7 @@ export default defineComponent({
window.open("https://www.graphite.design", "_blank");
},
actionNotImplemented() {
// eslint-disable-next-line no-alert
alert("This action is not yet implemented");
},
},