diff --git a/client/components/App.vue b/client/components/App.vue index 640a47f3..f65fe08a 100644 --- a/client/components/App.vue +++ b/client/components/App.vue @@ -142,7 +142,8 @@ class App extends Vue { get rootRoute() { const m = this.$route.path.match(/^(\/[^/]*).*$/i); - return (m ? m[1] : this.$route.path); + this.$root.rootRoute = (m ? m[1] : this.$route.path); + return this.$root.rootRoute; } itemTitleClass(path) { diff --git a/client/components/Reader/LoaderPage/LoaderPage.vue b/client/components/Reader/LoaderPage/LoaderPage.vue index ca5d97d3..3f647e78 100644 --- a/client/components/Reader/LoaderPage/LoaderPage.vue +++ b/client/components/Reader/LoaderPage/LoaderPage.vue @@ -32,11 +32,6 @@ class LoaderPage extends Vue { } mounted() { - //недостатки сторонних ui - this.$refs.input.$refs.input.addEventListener('keyup', (event) => { - if (event.key == 'Enter') - this.submitUrl(); - }); } activated() { @@ -55,6 +50,12 @@ class LoaderPage extends Vue { //loadUrl() ; } + + keyHook(event) { + //недостатки сторонних ui + if (document.activeElement == this.$refs.input.$refs.input && event.type == 'keyup' && event.key == 'Enter') + this.submitUrl(); + } } //----------------------------------------------------------------------------- diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index ada6e0db..efb8bd07 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -43,7 +43,7 @@ - + @@ -93,7 +93,7 @@ class Reader extends Vue { return {}; } - get componentActive() { + get pageActive() { let result = ''; if (this.loaderActive) @@ -107,7 +107,10 @@ class Reader extends Vue { } keyHook(event) { - //console.log(this.componentActive); + if (this.$root.rootRoute == '/reader') { + if (this.$refs.page && this.$refs.page.keyHook) + this.$refs.page.keyHook(event); + } } } //-----------------------------------------------------------------------------