mirror of https://github.com/requarks/wiki
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.
156 lines
4.8 KiB
156 lines
4.8 KiB
7 years ago
|
<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')
|
||
7 years ago
|
transition(name='navigator-subtitle-icon')
|
||
|
svg.icons.is-24.navigator-subtitle-icon(role='img', v-if='subtitleIcon')
|
||
|
title {{subtitleText}}
|
||
|
use(:xlink:href='subtitleIconClass')
|
||
7 years ago
|
h2 {{subtitleText}}
|
||
|
.navigator-action
|
||
7 years ago
|
.navigator-action-item(:class='{"is-active": userMenuShown}', @click='toggleUserMenu')
|
||
7 years ago
|
svg.icons.is-32(role='img')
|
||
|
title User
|
||
|
use(xlink:href='#nc-user-circle')
|
||
7 years ago
|
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')
|
||
7 years ago
|
transition(name='navigator-sd')
|
||
7 years ago
|
.navigator-sd(v-show='sdShown', v-cloak)
|
||
7 years ago
|
.navigator-sd-actions
|
||
7 years ago
|
a.is-active(href='', title='Search')
|
||
7 years ago
|
svg.icons.is-24(role='img')
|
||
|
title Search
|
||
|
use(xlink:href='#gg-search')
|
||
7 years ago
|
a(href='', title='New Document')
|
||
|
svg.icons.is-24(role='img')
|
||
7 years ago
|
title New Document
|
||
|
use(xlink:href='#nc-plus-circle')
|
||
7 years ago
|
a(href='', title='Edit Document')
|
||
|
svg.icons.is-24(role='img')
|
||
7 years ago
|
title Edit Document
|
||
7 years ago
|
use(xlink:href='#nc-pen-red')
|
||
7 years ago
|
a(href='', title='History')
|
||
|
svg.icons.is-24(role='img')
|
||
7 years ago
|
title History
|
||
7 years ago
|
use(xlink:href='#nc-restore')
|
||
7 years ago
|
a(href='', title='View Source')
|
||
|
svg.icons.is-24(role='img')
|
||
7 years ago
|
title View Source
|
||
7 years ago
|
use(xlink:href='#nc-code-editor')
|
||
7 years ago
|
a(href='', title='Move Document')
|
||
|
svg.icons.is-24(role='img')
|
||
7 years ago
|
title Move Document
|
||
|
use(xlink:href='#nc-move')
|
||
7 years ago
|
a(href='', title='Delete Document')
|
||
|
svg.icons.is-24(role='img')
|
||
7 years ago
|
title Delete Document
|
||
|
use(xlink:href='#nc-trash')
|
||
7 years ago
|
.navigator-sd-search
|
||
7 years ago
|
input(type='text', ref='iptSearch', placeholder='Search')
|
||
7 years ago
|
.navigator-sd-results
|
||
7 years ago
|
.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')
|
||
7 years ago
|
</template>
|
||
|
|
||
|
<script>
|
||
7 years ago
|
/* global siteConfig */
|
||
7 years ago
|
|
||
|
import { mapState } from 'vuex'
|
||
|
|
||
|
export default {
|
||
|
data() {
|
||
7 years ago
|
return {
|
||
7 years ago
|
sdShown: false,
|
||
|
userMenuShown: false
|
||
7 years ago
|
}
|
||
7 years ago
|
},
|
||
|
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() {
|
||
7 years ago
|
this.sdShown = !this.sdShown
|
||
7 years ago
|
this.userMenuShown = false
|
||
7 years ago
|
if (this.sdShown) {
|
||
|
this.$nextTick(() => {
|
||
7 years ago
|
this.bindOutsideClick()
|
||
7 years ago
|
this.$refs.iptSearch.focus()
|
||
|
})
|
||
7 years ago
|
} else {
|
||
|
this.unbindOutsideClick()
|
||
7 years ago
|
}
|
||
7 years ago
|
},
|
||
|
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'))
|
||
7 years ago
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|