editor.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template lang="pug">
  2. .editor
  3. nav-header
  4. template(slot='actions')
  5. v-btn(outline, color='green', @click.native.stop='save')
  6. v-icon(color='green', left) save
  7. span.white--text Save
  8. v-btn(icon): v-icon(color='red') close
  9. v-btn(icon, @click.native.stop='openModal(`properties`)'): v-icon(color='white') sort_by_alpha
  10. v-btn(icon, @click.native.stop='openModal(`access`)'): v-icon(color='white') vpn_lock
  11. v-content
  12. editor-code
  13. component(:is='currentModal')
  14. v-dialog(v-model='dialogProgress', persistent, max-width='300')
  15. v-card
  16. v-progress-linear.my-0(indeterminate, color='primary', height='5')
  17. v-card-text.text-xs-center
  18. .headline Saving
  19. .caption Please wait...
  20. </template>
  21. <script>
  22. import _ from 'lodash'
  23. export default {
  24. components: {
  25. editorCode: () => import(/* webpackChunkName: "editor-code" */ './editor/editor-code.vue'),
  26. editorModalAccess: () => import(/* webpackChunkName: "editor" */ './editor/editor-modal-access.vue'),
  27. editorModalProperties: () => import(/* webpackChunkName: "editor" */ './editor/editor-modal-properties.vue')
  28. },
  29. data() {
  30. return {
  31. currentModal: '',
  32. dialogProgress: false
  33. }
  34. },
  35. methods: {
  36. openModal(name) {
  37. this.currentModal = `editorModal${_.startCase(name)}`
  38. },
  39. closeModal() {
  40. _.delay(() => {
  41. this.currentModal = ``
  42. }, 500)
  43. },
  44. showProgressDialog(textKey) {
  45. this.dialogProgress = true
  46. },
  47. hideProgressDialog() {
  48. this.dialogProgress = false
  49. },
  50. save() {
  51. this.showProgressDialog('saving')
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang='scss'>
  57. </style>