Рефакторинг

This commit is contained in:
Book Pauk
2020-03-19 16:38:31 +07:00
parent ba85c54d7c
commit 2c57817dde
2 changed files with 77 additions and 104 deletions

View File

@@ -884,8 +884,8 @@ class TextPage extends Vue {
}
}
doToolBarToggle() {
this.$emit('tool-bar-toggle');
doToolBarToggle(event) {
this.$emit('do-action', {action: 'switchToolbar', event});
}
doScrollingToggle() {
@@ -947,11 +947,6 @@ class TextPage extends Vue {
const action = this.$root.readerActionByKeyEvent(event);
switch (action) {
case 'switchToolbar':
this.doToolBarToggle();
event.preventDefault();
event.stopPropagation();
break;
case 'bookBegin':
this.doHome();
break;
@@ -1067,7 +1062,7 @@ class TextPage extends Vue {
//движение вправо
this.doScrollingSpeedUp();
} else if (Math.abs(dy) < touchDelta && Math.abs(dx) < touchDelta) {
this.doToolBarToggle();
this.doToolBarToggle(event);
}
this.startTouch = null;
@@ -1094,7 +1089,7 @@ class TextPage extends Vue {
} else if (event.button == 1) {
this.doScrollingToggle();
} else if (event.button == 2) {
this.doToolBarToggle();
this.doToolBarToggle(event);
}
}