Resize GPU preview on sidebar toggle
This commit is contained in:
parent
dc33bed31c
commit
9ea17ce560
2 changed files with 12 additions and 0 deletions
|
|
@ -48,6 +48,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
created: function () {
|
created: function () {
|
||||||
|
var context = this
|
||||||
|
UIkit.util.on(document, 'hidden', '.toggle-hidden', function () {
|
||||||
|
context.$root.$emit('globalResizePreview')
|
||||||
|
})
|
||||||
|
UIkit.util.on(document, 'shown', '.toggle-hidden', function () {
|
||||||
|
context.$root.$emit('globalResizePreview')
|
||||||
|
})
|
||||||
|
|
||||||
window.addEventListener('resize', this.handleResize)
|
window.addEventListener('resize', this.handleResize)
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,10 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
// A global signal listener to change the GPU preview state
|
||||||
|
this.$root.$on('globalResizePreview', (state) => {
|
||||||
|
this.handleDoneResize()
|
||||||
|
})
|
||||||
// A global signal listener to change the GPU preview state
|
// A global signal listener to change the GPU preview state
|
||||||
this.$root.$on('globalTogglePreview', (state) => {
|
this.$root.$on('globalTogglePreview', (state) => {
|
||||||
console.log(`Toggling preview to ${state}`)
|
console.log(`Toggling preview to ${state}`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue