diff --git a/src/devtools/App.vue b/src/devtools/App.vue index e9881aa05..8c5d62419 100644 --- a/src/devtools/App.vue +++ b/src/devtools/App.vue @@ -67,6 +67,7 @@ export default { computed: mapState({ message: state => state.message, tab: state => state.tab, + view: state => state.view, newEventCount: state => state.events.newEventCount }), methods: { @@ -86,6 +87,12 @@ export default { refreshIcon.style.animation = 'rotate 1s' }) }, + switchView (mediaQueryEvent) { + this.$store.commit( + 'SWITCH_VIEW', + mediaQueryEvent.matches ? 'vertical' : 'horizontal' + ) + }, updateActiveBar () { const activeButton = this.$el.querySelector('.button.active') const activeBar = this.$el.querySelector('.active-bar') @@ -94,11 +101,16 @@ export default { } }, mounted () { + this.mediaQuery = window.matchMedia('(min-width: 685px)') + this.switchView(this.mediaQuery) + this.mediaQuery.addListener(this.switchView) + this.updateActiveBar() window.addEventListener('resize', this.updateActiveBar) }, destroyed () { window.removeEventListener('resize', this.updateActiveBar) + this.mediaQuery.removeListener(this.switchView) }, watch: { tab () { @@ -141,6 +153,10 @@ export default { .message-container height 1em cursor default + display none + @media (min-width: $wide - 300px) + display block + .message color $active-color diff --git a/src/devtools/components/SplitPane.vue b/src/devtools/components/SplitPane.vue index b8a95a8a2..b0a026ca8 100644 --- a/src/devtools/components/SplitPane.vue +++ b/src/devtools/components/SplitPane.vue @@ -3,19 +3,20 @@ @mousemove="dragMove" @mouseup="dragEnd" @mouseleave="dragEnd" - :class="{ dragging: dragging }"> -