Fixed layout resize

This commit is contained in:
benweet 2017-11-05 20:54:12 +00:00
parent 8c02d1e221
commit 167f3f50bc
2 changed files with 10 additions and 2 deletions

View File

@ -34,7 +34,7 @@
</template>
<script>
import { mapGetters, mapMutations } from 'vuex';
import { mapGetters, mapActions } from 'vuex';
import NavigationBar from './NavigationBar';
import ButtonBar from './ButtonBar';
import StatusBar from './StatusBar';
@ -67,7 +67,7 @@ export default {
},
},
methods: {
...mapMutations('layout', [
...mapActions('layout', [
'updateBodySize',
]),
saveSelection: () => editorSvc.saveSelection(true),

View File

@ -145,4 +145,12 @@ export default {
return computeStyles(state, localSettings, rootGetters);
},
},
actions: {
updateBodySize({ commit, dispatch, rootGetters }) {
commit('updateBodySize');
// Make sure both explorer and side bar are not open if body width is small
const localSettings = rootGetters['data/localSettings'];
dispatch('data/toggleExplorer', localSettings.showExplorer, { root: true });
},
},
};