소스 검색

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

Book Pauk 2 년 전
부모
커밋
481e1e840e
2개의 변경된 파일17개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 2
      client/components/Reader/Reader.vue
  2. 16 1
      client/components/Reader/TextPage/TextPage.vue

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

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

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

@@ -1137,7 +1137,22 @@ class TextPage {
                     //движение вправо
                     this.doScrollingSpeedUp();
                 } 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;