From 701dfd5496ff0276e2c31bdab83241e4bc75d797 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 17 Jan 2019 02:09:16 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B0=D0=BA=D1=86=D0=B8=D1=8E=20Up-Down?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/TextPage.vue | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 0949b802..cf9cd8d3 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -87,7 +87,7 @@ class TextPage extends Vue { this.fontName = 'arial'; this.lineInterval = 5;// px, межстрочный интервал this.textAlignJustify = true;// выравнивание по ширине - this.p = 30;// px, отступ параграфа + this.p = 60;// px, отступ параграфа this.indent = 20;// px, отступ всего текста слева и справа this.wordWrap = true; @@ -199,6 +199,18 @@ class TextPage extends Vue { this.linesDown = lines; } + doDown() { + if (this.linesDown && this.linesDown.length > 1) { + this.bookPos = this.linesDown[1].begin; + } + } + + doUp() { + if (this.linesUp && this.linesUp.length > 1) { + this.bookPos = this.linesUp[1].begin; + } + } + doPageDown() { if (this.linesDown) { let i = this.pageLineCount; @@ -234,6 +246,12 @@ class TextPage extends Vue { keyHook(event) { if (event.type == 'keydown') { switch (event.key) { + case 'ArrowDown': + this.doDown(); + break; + case 'ArrowUp': + this.doUp(); + break; case 'PageDown': this.doPageDown(); break;