-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
b19710e
commit fb1a09c
Showing
5 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<template> | ||
<div class="card floating"> | ||
<div class="card-content"> | ||
<p> | ||
{{ $t("prompts.discardEditorChanges") }} | ||
</p> | ||
</div> | ||
<div class="card-action"> | ||
<button | ||
@click="$store.commit('closeHovers')" | ||
class="button button--flat button--grey" | ||
:aria-label="$t('buttons.cancel')" | ||
:title="$t('buttons.cancel')" | ||
> | ||
{{ $t("buttons.cancel") }} | ||
</button> | ||
<button | ||
@click="submit" | ||
class="button button--flat button--red" | ||
:aria-label="$t('buttons.discardChanges')" | ||
:title="$t('buttons.discardChanges')" | ||
> | ||
{{ $t("buttons.discardChanges") }} | ||
</button> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapMutations } from "vuex"; | ||
import url from "@/utils/url"; | ||
export default { | ||
name: "discardEditorChanges", | ||
methods: { | ||
...mapMutations(["closeHovers"]), | ||
submit: async function () { | ||
this.$store.commit("updateRequest", {}); | ||
let uri = url.removeLastDir(this.$route.path) + "/"; | ||
this.$router.push({ path: uri }); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters