From 213f7e48c9476e8a69c32544be6f6bd92e3a51e7 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 3 Nov 2020 00:26:25 +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=20BookmarkSettings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BookmarkSettings/BookmarkSettings.vue | 59 +++++++++++++++++++ .../components/ExternalLibs/ExternalLibs.vue | 37 ++++++++---- client/components/share/Window.vue | 1 + 3 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 client/components/ExternalLibs/BookmarkSettings/BookmarkSettings.vue diff --git a/client/components/ExternalLibs/BookmarkSettings/BookmarkSettings.vue b/client/components/ExternalLibs/BookmarkSettings/BookmarkSettings.vue new file mode 100644 index 00000000..97653dd7 --- /dev/null +++ b/client/components/ExternalLibs/BookmarkSettings/BookmarkSettings.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/client/components/ExternalLibs/ExternalLibs.vue b/client/components/ExternalLibs/ExternalLibs.vue index 2b587acc..1baa4c28 100644 --- a/client/components/ExternalLibs/ExternalLibs.vue +++ b/client/components/ExternalLibs/ExternalLibs.vue @@ -23,8 +23,8 @@ Добавить закладку - - Настроить закладки (пока недоступно) + + Настроить закладки + @@ -108,6 +109,8 @@ import _ from 'lodash'; import Window from '../share/Window.vue'; import Dialog from '../share/Dialog.vue'; +import BookmarkSettings from './BookmarkSettings/BookmarkSettings.vue'; + import rstore from '../../store/modules/reader'; import * as utils from '../../share/utils'; @@ -118,7 +121,8 @@ const proxySubst = { export default @Component({ components: { Window, - Dialog + Dialog, + BookmarkSettings }, watch: { libs: function() { @@ -153,6 +157,8 @@ class ExternalLibs extends Vue { bookmarkDesc = ''; defaultRootLink = ''; + bookmarkSettingsActive = false; + created() { this.$root.addKeyHook(this.keyHook); @@ -549,9 +555,6 @@ class ExternalLibs extends Vue { this.addBookmarkVisible = false; } - bookmarkSettings() { - } - fullScreenToggle() { this.fullScreenActive = !this.fullScreenActive; if (this.fullScreenActive) { @@ -584,14 +587,28 @@ class ExternalLibs extends Vue { } } - keyHook() { + bookmarkSettings() { + this.bookmarkSettingsActive = true; + this.$nextTick(() => { + this.$refs.bookmarkSettings.init(); + }); + } + + closeBookmarkSettings() { + this.bookmarkSettingsActive = false; + } + + keyHook(event) { if (this.$root.rootRoute() == '/external-libs') { + if (this.bookmarkSettingsActive && this.$refs.bookmarkSettings.keyHook(event)) + return true; + if (this.$refs.dialogAddBookmark.active) return false; if (event.type == 'keydown' && event.key == 'F4') { - this.addBookmark() - return; + this.addBookmark(); + return true; } if (event.type == 'keydown' && event.key == 'Escape' && @@ -599,8 +616,8 @@ class ExternalLibs extends Vue { (document.activeElement != this.$refs.selectedLink.$refs.target || !this.$refs.selectedLink.menu) ) { this.close(); + return true; } - return true; } return false; } diff --git a/client/components/share/Window.vue b/client/components/share/Window.vue index 8805d119..98c816cc 100644 --- a/client/components/share/Window.vue +++ b/client/components/share/Window.vue @@ -124,6 +124,7 @@ class Window extends Vue { .main { background-color: transparent !important; z-index: 50; + overflow: hidden; } .xyfit {