Добавил правильный on-resize

This commit is contained in:
Book Pauk
2019-01-17 21:50:57 +07:00
parent 0413fa889d
commit 221776bd75
3 changed files with 5 additions and 3 deletions

View File

@@ -103,6 +103,9 @@ class App extends Vue {
document.addEventListener('keydown', (event) => {
this.keyHook(event);
});
window.addEventListener('resize', () => {
this.$root.$emit('resize');
});
}
mounted() {

View File

@@ -173,6 +173,7 @@ class Reader extends Vue {
toolBarToggle() {
this.commit('reader/setToolBarActive', !this.toolBarActive);
this.$root.$emit('resize');
}
buttonClick(button) {

View File

@@ -38,9 +38,7 @@ class TextPage extends Vue {
this.$emit('book-pos-changed', {bookPos: newValue});
}, 100);
window.addEventListener('resize', () => {
this.onResize();
});
this.$root.$on('resize', () => {this.$nextTick(this.onResize)});
}
mounted() {