mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 22:58:12 +08:00
Confirm when the browser window is closed and there is unsaved work (#397)
* - browser confirmation on page exit - prompt to save a document when closed will only trigger when unsaved * add back select document for close prompt * - name -> displayname - add preventPropigation to middle click
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { createApp } from "vue";
|
||||
|
||||
import { fullscreenModeChanged } from "@/utilities/fullscreen";
|
||||
import { onKeyUp, onKeyDown, onMouseMove, onMouseDown, onMouseUp, onMouseScroll, onWindowResize } from "@/utilities/input";
|
||||
import { onKeyUp, onKeyDown, onMouseMove, onMouseDown, onMouseUp, onMouseScroll, onWindowResize, onBeforeUnload } from "@/utilities/input";
|
||||
import "@/utilities/errors";
|
||||
import App from "@/App.vue";
|
||||
import { panicProxy } from "@/utilities/panic-proxy";
|
||||
@@ -21,6 +21,8 @@ const wasm = import("@/../wasm/pkg").then(panicProxy);
|
||||
window.addEventListener("resize", onWindowResize);
|
||||
onWindowResize();
|
||||
|
||||
window.addEventListener("beforeunload", onBeforeUnload);
|
||||
|
||||
document.addEventListener("contextmenu", (e) => e.preventDefault());
|
||||
document.addEventListener("fullscreenchange", () => fullscreenModeChanged());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user