Попытка сделать автоскроллинг текста

This commit is contained in:
Book Pauk
2019-02-01 00:22:32 +07:00
parent 4d78640337
commit 945d69ab8f
2 changed files with 120 additions and 32 deletions

View File

@@ -53,6 +53,7 @@
@book-pos-changed="bookPosChanged"
@tool-bar-toggle="toolBarToggle"
@full-screen-toogle="fullScreenToggle"
@scrolling-toggle="scrollingToggle"
></component>
</keep-alive>
@@ -249,6 +250,8 @@ class Reader extends Vue {
this.setPositionActive = false;
this.historyActive = false;
this.settingsActive = false;
if (this.scrollingActive)
this.scrollingToggle();
}
loaderToggle() {
@@ -273,6 +276,18 @@ class Reader extends Vue {
}
}
scrollingToggle() {
this.scrollingActive = !this.scrollingActive;
if (this.activePage == 'TextPage') {
const page = this.$refs.page;
if (this.scrollingActive) {
page.startTextScrolling();
} else {
page.stopTextScrolling();
}
}
}
historyToggle() {
this.historyActive = !this.historyActive;
if (this.historyActive) {
@@ -303,7 +318,10 @@ class Reader extends Vue {
break;
case 'setPosition':
this.setPositionToggle();
break;
break;
case 'scrolling':
this.scrollingToggle()
break;
case 'history':
this.historyToggle();
break;
@@ -536,6 +554,9 @@ class Reader extends Vue {
case 'KeyP':
this.setPositionToggle();
break;
case 'KeyZ':
this.scrollingToggle();
break;
case 'KeyH':
this.historyToggle();
break;