From 1121f9c918e68008ffa814d2782a56c0008e2916 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 28 Oct 2020 20:30:57 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20LibsPage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/LibsPage/LibsPage.vue | 13 ++++++++++++- client/components/Reader/Reader.vue | 10 ++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/client/components/Reader/LibsPage/LibsPage.vue b/client/components/Reader/LibsPage/LibsPage.vue index 7bd59a50..c89a8780 100644 --- a/client/components/Reader/LibsPage/LibsPage.vue +++ b/client/components/Reader/LibsPage/LibsPage.vue @@ -8,6 +8,7 @@ import Vue from 'vue'; import Component from 'vue-class-component'; import Window from '../../share/Window.vue'; +import * as utils from '../../../share/utils'; //import rstore from '../../../store/modules/reader'; export default @Component({ @@ -29,6 +30,16 @@ class LibsPage extends Vue { init() { this.popupWindow = window.open(`http://${window.location.host}/?p=external-libs#/external-libs`); + if (this.popupWindow) { + //Проверка закрытия окна + (async() => { + while(this.popupWindow) { + if (this.popupWindow && this.popupWindow.closed) + this.close(); + await utils.sleep(1000); + } + })(); + } this.loadLibs(); } @@ -54,7 +65,7 @@ class LibsPage extends Vue { }*/ close() { - this.$emit('do-action', {action: 'libs'}); + this.$emit('libs-close'); } } //----------------------------------------------------------------------------- diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 108ba033..4d586476 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -85,7 +85,7 @@ @stop-text-search="stopTextSearch"> - + @@ -714,6 +714,11 @@ class Reader extends Vue { } } + libsClose() { + if (this.libsActive) + this.libsToogle(); + } + libsToogle() { this.libsActive = !this.libsActive; if (this.libsActive) { @@ -1217,9 +1222,6 @@ class Reader extends Vue { if (!handled && this.copyTextActive) handled = this.$refs.copyTextPage.keyHook(event); - if (!handled && this.libsActive) - handled = this.$refs.libsPage.keyHook(event); - if (!handled && this.$refs.page && this.$refs.page.keyHook) handled = this.$refs.page.keyHook(event);