2017-12-30 07:00:49 +00:00
|
|
|
<template lang="pug">
|
|
|
|
.navigator
|
|
|
|
.navigator-bar
|
|
|
|
.navigator-fab
|
|
|
|
.navigator-fab-button(@click='toggleMainMenu')
|
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Navigation
|
|
|
|
use(xlink:href='#gg-apps-grid')
|
|
|
|
.navigator-title
|
|
|
|
h1 {{ siteTitle }}
|
|
|
|
.navigator-subtitle(:class='subtitleClass')
|
2017-12-31 06:20:38 +00:00
|
|
|
transition(name='navigator-subtitle-icon')
|
|
|
|
svg.icons.is-24.navigator-subtitle-icon(role='img', v-if='subtitleIcon')
|
|
|
|
title {{subtitleText}}
|
|
|
|
use(:xlink:href='subtitleIconClass')
|
2017-12-30 07:00:49 +00:00
|
|
|
h2 {{subtitleText}}
|
|
|
|
.navigator-action
|
2018-01-15 03:05:08 +00:00
|
|
|
.navigator-action-item(:class='{"is-active": userMenuShown}', @click='toggleUserMenu')
|
2017-12-30 07:00:49 +00:00
|
|
|
svg.icons.is-32(role='img')
|
|
|
|
title User
|
|
|
|
use(xlink:href='#nc-user-circle')
|
2018-01-15 03:05:08 +00:00
|
|
|
transition(name='navigator-action-item-dropdown')
|
|
|
|
ul.navigator-action-item-dropdown(v-show='userMenuShown', v-cloak)
|
|
|
|
li
|
|
|
|
label Account
|
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Account
|
|
|
|
use(xlink:href='#nc-man-green')
|
|
|
|
li(@click='logout')
|
|
|
|
label Sign out
|
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Sign Out
|
|
|
|
use(xlink:href='#nc-exit')
|
2017-12-31 06:20:38 +00:00
|
|
|
transition(name='navigator-sd')
|
2018-01-15 03:05:08 +00:00
|
|
|
.navigator-sd(v-show='sdShown', v-cloak)
|
2017-12-31 06:20:38 +00:00
|
|
|
.navigator-sd-actions
|
2017-12-31 19:40:28 +00:00
|
|
|
a.is-active(href='', title='Search')
|
2017-12-31 06:20:38 +00:00
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Search
|
|
|
|
use(xlink:href='#gg-search')
|
2018-01-01 06:52:28 +00:00
|
|
|
a(href='', title='New Document')
|
|
|
|
svg.icons.is-24(role='img')
|
2017-12-31 06:20:38 +00:00
|
|
|
title New Document
|
|
|
|
use(xlink:href='#nc-plus-circle')
|
2018-01-01 06:52:28 +00:00
|
|
|
a(href='', title='Edit Document')
|
|
|
|
svg.icons.is-24(role='img')
|
2017-12-31 19:40:28 +00:00
|
|
|
title Edit Document
|
2017-12-31 06:20:38 +00:00
|
|
|
use(xlink:href='#nc-pen-red')
|
2018-01-01 06:52:28 +00:00
|
|
|
a(href='', title='History')
|
|
|
|
svg.icons.is-24(role='img')
|
2017-12-31 19:40:28 +00:00
|
|
|
title History
|
2017-12-31 06:20:38 +00:00
|
|
|
use(xlink:href='#nc-restore')
|
2018-01-01 06:52:28 +00:00
|
|
|
a(href='', title='View Source')
|
|
|
|
svg.icons.is-24(role='img')
|
2017-12-31 19:40:28 +00:00
|
|
|
title View Source
|
2017-12-31 06:20:38 +00:00
|
|
|
use(xlink:href='#nc-code-editor')
|
2018-01-01 06:52:28 +00:00
|
|
|
a(href='', title='Move Document')
|
|
|
|
svg.icons.is-24(role='img')
|
2017-12-31 19:40:28 +00:00
|
|
|
title Move Document
|
|
|
|
use(xlink:href='#nc-move')
|
2018-01-01 06:52:28 +00:00
|
|
|
a(href='', title='Delete Document')
|
|
|
|
svg.icons.is-24(role='img')
|
2017-12-31 19:40:28 +00:00
|
|
|
title Delete Document
|
|
|
|
use(xlink:href='#nc-trash')
|
2017-12-31 06:20:38 +00:00
|
|
|
.navigator-sd-search
|
2018-01-01 06:52:28 +00:00
|
|
|
input(type='text', ref='iptSearch', placeholder='Search')
|
2017-12-31 06:20:38 +00:00
|
|
|
.navigator-sd-results
|
2018-01-01 06:52:28 +00:00
|
|
|
.navigator-sd-footer
|
|
|
|
a(href='', title='Settings')
|
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Settings
|
|
|
|
use(xlink:href='#nc-gear')
|
|
|
|
a(href='', title='Users')
|
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Users
|
|
|
|
use(xlink:href='#nc-users')
|
|
|
|
a(href='', title='Assets')
|
|
|
|
svg.icons.is-24(role='img')
|
|
|
|
title Assets
|
|
|
|
use(xlink:href='#nc-image')
|
2017-12-30 07:00:49 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-01-30 03:58:05 +00:00
|
|
|
/* global siteConfig */
|
2017-12-30 07:00:49 +00:00
|
|
|
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
2017-12-31 06:20:38 +00:00
|
|
|
return {
|
2018-01-15 03:05:08 +00:00
|
|
|
sdShown: false,
|
|
|
|
userMenuShown: false
|
2017-12-31 06:20:38 +00:00
|
|
|
}
|
2017-12-30 07:00:49 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState('navigator', [
|
|
|
|
'subtitleShown',
|
|
|
|
'subtitleStyle',
|
|
|
|
'subtitleText',
|
|
|
|
'subtitleIcon'
|
|
|
|
]),
|
|
|
|
siteTitle() {
|
|
|
|
return siteConfig.title
|
|
|
|
},
|
|
|
|
subtitleClass() {
|
|
|
|
return {
|
|
|
|
'is-active': this.subtitleShown,
|
|
|
|
'is-error': this.subtitleStyle === 'error',
|
|
|
|
'is-warning': this.subtitleStyle === 'warning',
|
|
|
|
'is-success': this.subtitleStyle === 'success',
|
|
|
|
'is-info': this.subtitleStyle === 'info'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
subtitleIconClass() { return '#' + this.subtitleIcon }
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleMainMenu() {
|
2017-12-31 06:20:38 +00:00
|
|
|
this.sdShown = !this.sdShown
|
2018-01-15 03:05:08 +00:00
|
|
|
this.userMenuShown = false
|
2018-01-01 06:52:28 +00:00
|
|
|
if (this.sdShown) {
|
|
|
|
this.$nextTick(() => {
|
2018-01-15 03:05:08 +00:00
|
|
|
this.bindOutsideClick()
|
2018-01-01 06:52:28 +00:00
|
|
|
this.$refs.iptSearch.focus()
|
|
|
|
})
|
2018-01-15 03:05:08 +00:00
|
|
|
} else {
|
|
|
|
this.unbindOutsideClick()
|
2018-01-01 06:52:28 +00:00
|
|
|
}
|
2018-01-15 03:05:08 +00:00
|
|
|
},
|
|
|
|
toggleUserMenu() {
|
|
|
|
this.userMenuShown = !this.userMenuShown
|
|
|
|
this.sdShown = false
|
|
|
|
if (this.userMenuShown) {
|
|
|
|
this.bindOutsideClick()
|
|
|
|
} else {
|
|
|
|
this.unbindOutsideClick()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
bindOutsideClick() {
|
|
|
|
document.addEventListener('mousedown', this.handleOutsideClick, false)
|
|
|
|
},
|
|
|
|
unbindOutsideClick() {
|
|
|
|
document.removeEventListener('mousedown', this.handleOutsideClick, false)
|
|
|
|
},
|
|
|
|
handleOutsideClick(ev) {
|
|
|
|
if (!this.$el.contains(ev.target)) {
|
|
|
|
this.sdShown = false
|
|
|
|
this.userMenuShown = false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
logout() {
|
|
|
|
window.location.assign(this.$helpers.resolvePath('logout'))
|
2017-12-30 07:00:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|