Showing
3 changed files
with
24 additions
and
3 deletions
| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 8 | <navbar /> | 8 | <navbar /> |
| 9 | <tags-view v-if="needTagsView" /> | 9 | <tags-view v-if="needTagsView" /> |
| 10 | </div> | 10 | </div> |
| 11 | - <app-main /> | 11 | + <app-main ref="appMainBlock" /> |
| 12 | <right-panel v-if="false"> | 12 | <right-panel v-if="false"> |
| 13 | <settings /> | 13 | <settings /> |
| 14 | </right-panel> | 14 | </right-panel> | ... | ... |
| ... | @@ -6,6 +6,7 @@ const WIDTH = 992; // refer to Bootstrap's responsive design | ... | @@ -6,6 +6,7 @@ const WIDTH = 992; // refer to Bootstrap's responsive design |
| 6 | export default { | 6 | export default { |
| 7 | watch: { | 7 | watch: { |
| 8 | $route(route) { | 8 | $route(route) { |
| 9 | + this.getBlockCurrentHeight(); | ||
| 9 | if (this.device === "mobile" && this.sidebar.opened) { | 10 | if (this.device === "mobile" && this.sidebar.opened) { |
| 10 | store.dispatch("app/closeSideBar", { withoutAnimation: false }); | 11 | store.dispatch("app/closeSideBar", { withoutAnimation: false }); |
| 11 | } | 12 | } |
| ... | @@ -22,7 +23,10 @@ export default { | ... | @@ -22,7 +23,10 @@ export default { |
| 22 | if (isMobile) { | 23 | if (isMobile) { |
| 23 | store.dispatch("app/toggleDevice", "mobile"); | 24 | store.dispatch("app/toggleDevice", "mobile"); |
| 24 | store.dispatch("app/closeSideBar", { withoutAnimation: true }); | 25 | store.dispatch("app/closeSideBar", { withoutAnimation: true }); |
| 25 | - } | 26 | + }; |
| 27 | + this.$nextTick(() => { | ||
| 28 | + this.getBlockCurrentHeight(); | ||
| 29 | + }); | ||
| 26 | }, | 30 | }, |
| 27 | methods: { | 31 | methods: { |
| 28 | // use $_ for mixins properties | 32 | // use $_ for mixins properties |
| ... | @@ -41,5 +45,11 @@ export default { | ... | @@ -41,5 +45,11 @@ export default { |
| 41 | } | 45 | } |
| 42 | } | 46 | } |
| 43 | }, | 47 | }, |
| 48 | + getBlockCurrentHeight() { | ||
| 49 | + let appHeaderHeight = this.$refs.headerRef.clientHeight; | ||
| 50 | + let appMainHeight = this.$refs.appMainBlock.$el.clientHeight; | ||
| 51 | + this.$store.dispatch("app/setAppHeaderBlockCH", appHeaderHeight); | ||
| 52 | + this.$store.dispatch("app/setAppMainBlockCH", appMainHeight); | ||
| 53 | + }, | ||
| 44 | }, | 54 | }, |
| 45 | }; | 55 | }; | ... | ... |
| ... | @@ -10,6 +10,8 @@ const state = { | ... | @@ -10,6 +10,8 @@ const state = { |
| 10 | device: "desktop", | 10 | device: "desktop", |
| 11 | //size: Cookies.get('size') || 'medium' | 11 | //size: Cookies.get('size') || 'medium' |
| 12 | size: localStorage.getItem("size") || "medium", | 12 | size: localStorage.getItem("size") || "medium", |
| 13 | + headerBlockClientHeight: null, | ||
| 14 | + appMainBlockClientHeight: null, | ||
| 13 | }; | 15 | }; |
| 14 | 16 | ||
| 15 | const mutations = { | 17 | const mutations = { |
| ... | @@ -41,7 +43,10 @@ const mutations = { | ... | @@ -41,7 +43,10 @@ const mutations = { |
| 41 | SET_APPHEADERBLOCKCH: (state, height) => { | 43 | SET_APPHEADERBLOCKCH: (state, height) => { |
| 42 | state.headerBlockClientHeight = height; | 44 | state.headerBlockClientHeight = height; |
| 43 | }, | 45 | }, |
| 44 | -} | 46 | + SET_APPMAINBLOCKCH: (state, height) => { |
| 47 | + state.appMainBlockClientHeight = height; | ||
| 48 | + }, | ||
| 49 | +}; | ||
| 45 | 50 | ||
| 46 | const actions = { | 51 | const actions = { |
| 47 | toggleSideBar({ commit }) { | 52 | toggleSideBar({ commit }) { |
| ... | @@ -56,6 +61,12 @@ const actions = { | ... | @@ -56,6 +61,12 @@ const actions = { |
| 56 | setSize({ commit }, size) { | 61 | setSize({ commit }, size) { |
| 57 | commit("SET_SIZE", size); | 62 | commit("SET_SIZE", size); |
| 58 | }, | 63 | }, |
| 64 | + setAppHeaderBlockCH({ commit }, height) { | ||
| 65 | + commit("SET_APPHEADERBLOCKCH", height); | ||
| 66 | + }, | ||
| 67 | + setAppMainBlockCH({ commit }, height) { | ||
| 68 | + commit("SET_APPMAINBLOCKCH", height); | ||
| 69 | + }, | ||
| 59 | }; | 70 | }; |
| 60 | 71 | ||
| 61 | export default { | 72 | export default { | ... | ... |
-
Please register or login to post a comment