2016-10-28 01:01:48 +09:00
|
|
|
import UserPanel from './components/user_panel/user_panel.vue'
|
2016-11-07 04:11:23 +09:00
|
|
|
import NavPanel from './components/nav_panel/nav_panel.vue'
|
2016-11-28 03:44:56 +09:00
|
|
|
import Notifications from './components/notifications/notifications.vue'
|
2017-05-13 01:54:12 +09:00
|
|
|
import UserFinder from './components/user_finder/user_finder.vue'
|
2018-02-04 00:27:33 +09:00
|
|
|
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
|
2018-01-26 23:11:34 +09:00
|
|
|
import ChatPanel from './components/chat_panel/chat_panel.vue'
|
2016-10-27 02:03:55 +09:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'app',
|
|
|
|
components: {
|
2016-11-07 04:11:23 +09:00
|
|
|
UserPanel,
|
2016-11-28 03:44:56 +09:00
|
|
|
NavPanel,
|
2017-05-13 01:54:12 +09:00
|
|
|
Notifications,
|
2018-01-26 23:11:34 +09:00
|
|
|
UserFinder,
|
2018-02-04 00:27:33 +09:00
|
|
|
ChatPanel,
|
|
|
|
InstanceSpecificPanel
|
2016-11-04 00:58:32 +09:00
|
|
|
},
|
2017-01-18 01:27:39 +09:00
|
|
|
data: () => ({
|
|
|
|
mobileActivePanel: 'timeline'
|
|
|
|
}),
|
2016-11-04 00:58:32 +09:00
|
|
|
computed: {
|
2016-11-28 03:44:56 +09:00
|
|
|
currentUser () { return this.$store.state.users.currentUser },
|
2017-02-17 00:59:06 +09:00
|
|
|
background () {
|
|
|
|
return this.currentUser.background_image || this.$store.state.config.background
|
|
|
|
},
|
2017-02-17 01:44:36 +09:00
|
|
|
logoStyle () { return { 'background-image': `url(${this.$store.state.config.logo})` } },
|
2017-02-17 00:59:06 +09:00
|
|
|
style () { return { 'background-image': `url(${this.background})` } },
|
2018-01-26 23:11:34 +09:00
|
|
|
sitename () { return this.$store.state.config.name },
|
2018-02-04 08:36:10 +09:00
|
|
|
chat () { return this.$store.state.chat.channel.state === 'joined' },
|
2018-02-04 00:27:33 +09:00
|
|
|
showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel}
|
2017-01-18 01:27:39 +09:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
activatePanel (panelName) {
|
|
|
|
this.mobileActivePanel = panelName
|
2017-02-19 05:55:16 +09:00
|
|
|
},
|
|
|
|
scrollToTop () {
|
|
|
|
window.scrollTo(0, 0)
|
2017-07-02 19:25:34 +09:00
|
|
|
},
|
|
|
|
logout () {
|
|
|
|
this.$store.dispatch('logout')
|
2017-01-18 01:27:39 +09:00
|
|
|
}
|
2016-10-27 02:03:55 +09:00
|
|
|
}
|
|
|
|
}
|