fix: discard changes redirect

This commit is contained in:
Nicolas Giard 2019-01-01 17:08:16 -05:00
parent 8c6aca6623
commit aa57ea920e

View File

@ -19,7 +19,7 @@
v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('editor:page') }} span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('editor:page') }}
v-btn( v-btn(
v-if='mode === `create` && path !== `home`' v-if='path !== `home`'
outline outline
color='red' color='red'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }' :class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
@ -29,9 +29,6 @@
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('common:actions.discard') }} span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('common:actions.discard') }}
v-content v-content
component(:is='currentEditor') component(:is='currentEditor')
v-btn(fixed, bottom, right, color='red', round, @click='exit', dark)
v-icon(left) close
span Close Editor
editor-modal-properties(v-model='dialogProps') editor-modal-properties(v-model='dialogProps')
editor-modal-editorselect(v-model='dialogEditorSelector') editor-modal-editorselect(v-model='dialogEditorSelector')
editor-modal-unsaved(v-model='dialogUnsaved', @discard='exitGo') editor-modal-unsaved(v-model='dialogUnsaved', @discard='exitGo')
@ -265,7 +262,11 @@ export default {
this.$store.commit(`loadingStart`, 'editor-close') this.$store.commit(`loadingStart`, 'editor-close')
this.currentEditor = '' this.currentEditor = ''
_.delay(() => { _.delay(() => {
window.location.assign(`/${this.$store.get('page/path')}`) if (this.$store.get('editor/mode') === 'create') {
window.location.assign(`/`)
} else {
window.location.assign(`/${this.$store.get('page/path')}`)
}
}, 500) }, 500)
} }
} }