Browse Source

Добавлен переход в полноэкраннй режим по двойному тапу в середину экрана

Book Pauk 2 năm trước cách đây
mục cha
commit
481e1e840e

+ 1 - 2
client/components/Reader/Reader.vue

@@ -839,8 +839,7 @@ class Reader {
     }
     }
 
 
     fullScreenToggle() {
     fullScreenToggle() {
-        this.fullScreenActive = !this.fullScreenActive;
-        if (this.fullScreenActive) {
+        if (!this.$q.fullscreen.isActive) {
             this.$q.fullscreen.request();
             this.$q.fullscreen.request();
         } else {
         } else {
             this.$q.fullscreen.exit();
             this.$q.fullscreen.exit();

+ 16 - 1
client/components/Reader/TextPage/TextPage.vue

@@ -1137,7 +1137,22 @@ class TextPage {
                     //движение вправо
                     //движение вправо
                     this.doScrollingSpeedUp();
                     this.doScrollingSpeedUp();
                 } else if (Math.abs(dy) < touchDelta && Math.abs(dx) < touchDelta) {
                 } else if (Math.abs(dy) < touchDelta && Math.abs(dx) < touchDelta) {
-                    this.doToolBarToggle(event);
+                    if (this.clickAction === 'tb' || this.clickAction === 'fs') {
+                        this.clickAction = 'fs';
+                        return;
+                    }
+
+                    (async() => {
+                        this.clickAction = 'tb';
+                        let i = 20;
+                        while (i-- > 0 && this.clickAction === 'tb')
+                            await utils.sleep(10);
+                        if (this.clickAction === 'tb')
+                            this.doToolBarToggle();
+                        else
+                            this.doFullScreenToggle();
+                        this.clickAction = '';
+                    })();
                 }
                 }
 
 
                 this.startTouch = null;
                 this.startTouch = null;