2
0

navigator.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template lang="pug">
  2. .navigator
  3. .navigator-bar
  4. .navigator-fab
  5. .navigator-fab-button(@click='toggleMainMenu')
  6. svg.icons.is-24(role='img')
  7. title Navigation
  8. use(xlink:href='#gg-apps-grid')
  9. .navigator-title
  10. h1 {{ siteTitle }}
  11. .navigator-subtitle(:class='subtitleClass')
  12. transition(name='navigator-subtitle-icon')
  13. svg.icons.is-24.navigator-subtitle-icon(role='img', v-if='subtitleIcon')
  14. title {{subtitleText}}
  15. use(:xlink:href='subtitleIconClass')
  16. h2 {{subtitleText}}
  17. .navigator-action
  18. .navigator-action-item
  19. svg.icons.is-32(role='img')
  20. title User
  21. use(xlink:href='#nc-user-circle')
  22. transition(name='navigator-sd')
  23. .navigator-sd(v-show='sdShown')
  24. .navigator-sd-actions
  25. a.is-active(href='', title='Search')
  26. svg.icons.is-24(role='img')
  27. title Search
  28. use(xlink:href='#gg-search')
  29. a(href='')
  30. svg.icons.is-24(role='img', title='New Document')
  31. title New Document
  32. use(xlink:href='#nc-plus-circle')
  33. a(href='')
  34. svg.icons.is-24(role='img', title='Edit Document')
  35. title Edit Document
  36. use(xlink:href='#nc-pen-red')
  37. a(href='')
  38. svg.icons.is-24(role='img', title='History')
  39. title History
  40. use(xlink:href='#nc-restore')
  41. a(href='')
  42. svg.icons.is-24(role='img', title='View Source')
  43. title View Source
  44. use(xlink:href='#nc-code-editor')
  45. a(href='')
  46. svg.icons.is-24(role='img', title='Move Document')
  47. title Move Document
  48. use(xlink:href='#nc-move')
  49. a(href='')
  50. svg.icons.is-24(role='img', title='Delete Document')
  51. title Delete Document
  52. use(xlink:href='#nc-trash')
  53. .navigator-sd-search
  54. input(type='text', placeholder='Search')
  55. .navigator-sd-results
  56. </template>
  57. <script>
  58. /* global CONSTANTS, graphQL, siteConfig */
  59. import { mapState } from 'vuex'
  60. export default {
  61. name: 'navigator',
  62. data() {
  63. return {
  64. sdShown: false
  65. }
  66. },
  67. computed: {
  68. ...mapState('navigator', [
  69. 'subtitleShown',
  70. 'subtitleStyle',
  71. 'subtitleText',
  72. 'subtitleIcon'
  73. ]),
  74. siteTitle() {
  75. return siteConfig.title
  76. },
  77. subtitleClass() {
  78. return {
  79. 'is-active': this.subtitleShown,
  80. 'is-error': this.subtitleStyle === 'error',
  81. 'is-warning': this.subtitleStyle === 'warning',
  82. 'is-success': this.subtitleStyle === 'success',
  83. 'is-info': this.subtitleStyle === 'info'
  84. }
  85. },
  86. subtitleIconClass() { return '#' + this.subtitleIcon }
  87. },
  88. methods: {
  89. toggleMainMenu() {
  90. this.sdShown = !this.sdShown
  91. // this.$store.dispatch('navigator/alert', {
  92. // style: 'success',
  93. // icon: 'gg-check',
  94. // msg: 'Changes were saved successfully!'
  95. // })
  96. }
  97. },
  98. mounted() {
  99. }
  100. }
  101. </script>