-
+
+
+
-
+
+
+
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 53ecc08319..ad72ce0449 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -5,6 +5,9 @@ import routes from './routes'
import App from '../App.vue'
const afterStoreSetup = ({ store, i18n }) => {
+ const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
+ store.dispatch('setMobileLayout', width <= 800)
+
window.fetch('/api/statusnet/config.json')
.then((res) => res.json())
.then((data) => {
diff --git a/src/modules/interface.js b/src/modules/interface.js
index 956c9cb377..71554787ff 100644
--- a/src/modules/interface.js
+++ b/src/modules/interface.js
@@ -11,7 +11,8 @@ const defaultState = {
window.CSS.supports('filter', 'drop-shadow(0 0)') ||
window.CSS.supports('-webkit-filter', 'drop-shadow(0 0)')
)
- }
+ },
+ mobileLayout: false
}
const interfaceMod = {
@@ -31,6 +32,9 @@ const interfaceMod = {
},
setNotificationPermission (state, permission) {
state.notificationPermission = permission
+ },
+ setMobileLayout (state, value) {
+ state.mobileLayout = value
}
},
actions: {
@@ -42,6 +46,10 @@ const interfaceMod = {
},
setNotificationPermission ({ commit }, permission) {
commit('setNotificationPermission', permission)
+ },
+ setMobileLayout ({ commit }, value) {
+ console.log('setMobileLayout called')
+ commit('setMobileLayout', value)
}
}
}