You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

  1. <template lang="pug">
  2. transition(:duration="400")
  3. .modal(v-show='isShown', v-cloak)
  4. transition(name='modal-background')
  5. .modal-background(v-show='isShown')
  6. .modal-container
  7. transition(name='modal-content')
  8. .modal-content(v-show='isShown')
  9. header.is-orange {{ $t('modal.discardpagetitle') }}
  10. section
  11. span(v-if='mode === "create"') {{ $t('modal.discardpagecreate') }}
  12. span(v-else) {{ $t('modal.discardpageedit') }}
  13. footer
  14. a.button.is-grey.is-outlined(v-on:click='stay') {{ $t('modal.discardpagestay') }}
  15. a.button.is-orange(v-on:click='discard') {{ $t('modal.discard') }}
  16. </template>
  17. <script>
  18. export default {
  19. name: 'modal-discard-page',
  20. props: ['mode', 'currentPath'],
  21. data () {
  22. return {}
  23. },
  24. computed: {
  25. isShown () {
  26. return this.$store.state.modalDiscardPage.shown
  27. }
  28. },
  29. methods: {
  30. stay: function () {
  31. this.$store.dispatch('modalDiscardPage/close')
  32. },
  33. discard: function () {
  34. if(this.mode === 'create') {
  35. window.location.assign('/')
  36. } else {
  37. window.location.assign('/' + this.currentPath)
  38. }
  39. }
  40. }
  41. }
  42. </script>