You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
feat: prompt to confirm discard editor changes (#2948)
* chore: update he.json * feat: prompt to confirm discard editor changes --------- Co-authored-by: Oleg Lobanov <oleg@lobanov.me>
This commit is contained in:
@@ -107,10 +107,6 @@ export default {
|
||||
this.editor.focus();
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
let uri = url.removeLastDir(this.$route.path) + "/";
|
||||
this.$router.push({ path: uri });
|
||||
},
|
||||
keyEvent(event) {
|
||||
if (event.code === "Escape") {
|
||||
this.close();
|
||||
@@ -140,6 +136,13 @@ export default {
|
||||
}
|
||||
},
|
||||
close() {
|
||||
const originalContent = this.req.content;
|
||||
const currentContent = this.editor.getValue();
|
||||
if (originalContent !== currentContent) {
|
||||
this.$store.commit("showHover", "discardEditorChanges");
|
||||
return;
|
||||
}
|
||||
|
||||
this.$store.commit("updateRequest", {});
|
||||
|
||||
let uri = url.removeLastDir(this.$route.path) + "/";
|
||||
|
||||
Reference in New Issue
Block a user