aboutsummaryrefslogtreecommitdiff
path: root/src/App.js
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2020-08-27 14:45:03 +0000
committerShpuld Shpludson <shp@cock.li>2020-08-27 14:45:03 +0000
commite768ec1fca2f7580d111b0878a9695b0c8b9dbb1 (patch)
tree668ebbcd6818b3c7ad70a372c9f77fa9cffb6a3f /src/App.js
parent5d49edc823ba2ea3e34d4fd6c5efcc84ef9712f7 (diff)
parentd09f43ba7a179cdca9a2d808631f8ba213dd7710 (diff)
Merge branch '2.1.0-rc0' into 'master'
2.1.0 into master See merge request pleroma/pleroma-fe!1217
Diffstat (limited to 'src/App.js')
-rw-r--r--src/App.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/App.js b/src/App.js
index 61b5eec1..ded772fa 100644
--- a/src/App.js
+++ b/src/App.js
@@ -6,13 +6,15 @@ import InstanceSpecificPanel from './components/instance_specific_panel/instance
import FeaturesPanel from './components/features_panel/features_panel.vue'
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
import ChatPanel from './components/chat_panel/chat_panel.vue'
+import SettingsModal from './components/settings_modal/settings_modal.vue'
import MediaModal from './components/media_modal/media_modal.vue'
import SideDrawer from './components/side_drawer/side_drawer.vue'
import MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue'
import MobileNav from './components/mobile_nav/mobile_nav.vue'
import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue'
import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
-import { windowWidth } from './services/window_utils/window_utils'
+import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue'
+import { windowWidth, windowHeight } from './services/window_utils/window_utils'
export default {
name: 'app',
@@ -29,8 +31,10 @@ export default {
SideDrawer,
MobilePostStatusButton,
MobileNav,
+ SettingsModal,
UserReportingModal,
- PostStatusModal
+ PostStatusModal,
+ GlobalNoticeList
},
data: () => ({
mobileActivePanel: 'timeline',
@@ -45,7 +49,8 @@ export default {
}),
created () {
// Load the locale from the storage
- this.$i18n.locale = this.$store.getters.mergedConfig.interfaceLanguage
+ const val = this.$store.getters.mergedConfig.interfaceLanguage
+ this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
window.addEventListener('resize', this.updateMobileState)
},
destroyed () {
@@ -99,7 +104,12 @@ export default {
},
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel },
isMobileLayout () { return this.$store.state.interface.mobileLayout },
- privateMode () { return this.$store.state.instance.private }
+ privateMode () { return this.$store.state.instance.private },
+ sidebarAlign () {
+ return {
+ 'order': this.$store.state.instance.sidebarRight ? 99 : 0
+ }
+ }
},
methods: {
scrollToTop () {
@@ -112,12 +122,17 @@ export default {
onSearchBarToggled (hidden) {
this.searchBarHidden = hidden
},
+ openSettingsModal () {
+ this.$store.dispatch('openSettingsModal')
+ },
updateMobileState () {
const mobileLayout = windowWidth() <= 800
+ const layoutHeight = windowHeight()
const changed = mobileLayout !== this.isMobileLayout
if (changed) {
this.$store.dispatch('setMobileLayout', mobileLayout)
}
+ this.$store.dispatch('setLayoutHeight', layoutHeight)
}
}
}