From 6aa935141b985ddf0233dd6526c57a03cf79403b Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 16 Jan 2019 04:58:47 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/TextPage/TextPage.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index e00189cd..54639cfe 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -18,7 +18,7 @@ import bookManager from '../share/bookManager'; export default @Component({ watch: { bookPos: function(newValue) { - this.$emit('book-pos-changed', {bookPos: newValue}); + this.debouncedEmitPosChange(newValue); this.drawPage(); }, }, @@ -36,6 +36,10 @@ class TextPage extends Vue { this.dispatch = this.$store.dispatch; this.config = this.$store.state.config; this.reader = this.$store.state.reader; + + this.debouncedEmitPosChange = _.debounce((newValue) => { + this.$emit('book-pos-changed', {bookPos: newValue}); + }, 100); } showBook() {