Bladeren bron

Поправки багов

Book Pauk 6 jaren geleden
bovenliggende
commit
c49abaf8e5
2 gewijzigde bestanden met toevoegingen van 14 en 11 verwijderingen
  1. 13 9
      client/components/Reader/TextPage/TextPage.vue
  2. 1 2
      client/components/Reader/share/BookParser.js

+ 13 - 9
client/components/Reader/TextPage/TextPage.vue

@@ -130,19 +130,23 @@ class TextPage extends Vue {
     }
     }
     
     
     pageDown() {
     pageDown() {
-        let i = this.pageLineCount;
-        i--;
-        if (this.linesDown && this.linesDown.length > i) {
-            this.bookPos = this.linesDown[i].begin;
+        if (this.linesDown) {
+            let i = this.pageLineCount;
+            i--;
+            if (i >= 0 && this.linesDown.length > i) {
+                this.bookPos = this.linesDown[i].begin;
+            }
         }
         }
     }
     }
 
 
     pageUp() {
     pageUp() {
-        let i = this.pageLineCount;
-        i--;
-        i = (i > this.linesUp.length - 1 ? this.linesUp.length - 1 : i);
-        if (this.linesUp && this.linesUp.length > i) {
-            this.bookPos = this.linesUp[i].begin;
+        if (this.linesUp) {
+            let i = this.pageLineCount;
+            i--;
+            i = (i > this.linesUp.length - 1 ? this.linesUp.length - 1 : i);
+            if (i >= 0 && this.linesUp.length > i) {
+                this.bookPos = this.linesUp[i].begin;
+            }
         }
         }
     }
     }
 
 

+ 1 - 2
client/components/Reader/share/BookParser.js

@@ -6,8 +6,7 @@ export default class BookParser {
         // defaults
         // defaults
         this.p = 30;// px, отступ параграфа
         this.p = 30;// px, отступ параграфа
         this.w = 300;// px, ширина страницы
         this.w = 300;// px, ширина страницы
-        this.textAlignJustify = false;// выравнивание по ширине
-        this.wordWrap = false;// перенос по слогам, если textAlignJustify = true
+        this.wordWrap = false;// перенос по слогам
 
 
         // заглушка
         // заглушка
         this.measureText = (text, style) => {// eslint-disable-line no-unused-vars
         this.measureText = (text, style) => {// eslint-disable-line no-unused-vars