diff --git a/client/components/Search/PageScroller/PageScroller.vue b/client/components/Search/PageScroller/PageScroller.vue
new file mode 100644
index 0000000..161ea1c
--- /dev/null
+++ b/client/components/Search/PageScroller/PageScroller.vue
@@ -0,0 +1,58 @@
+
+
+
+ Страница
+
+
+
+
+
+ из {{ totalPages }}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue
index 57dcb14..49f738a 100644
--- a/client/components/Search/Search.vue
+++ b/client/components/Search/Search.vue
@@ -62,7 +62,7 @@
@click="selectLang"
/>
-
+
@@ -76,18 +76,9 @@
-
-
- Страница
-
-
-
-
-
- из {{ totalPages }}
-
+
-
@@ -97,18 +88,9 @@
-
-
- Страница
-
-
-
-
-
- из {{ totalPages }}
-
+
-
@@ -117,14 +99,14 @@
//-----------------------------------------------------------------------------
import vueComponent from '../vueComponent.js';
-import NumInput from '../share/NumInput.vue';
+import PageScroller from './PageScroller/PageScroller.vue';
import * as utils from '../../share/utils';
//import _ from 'lodash';
const componentOptions = {
components: {
- NumInput,
+ PageScroller,
},
watch: {
config() {
@@ -250,13 +232,19 @@ class Search {
if (curScrollTop - this.lastScrollTop > 0) {
this.$refs.toolPanel.style.position = 'relative';
this.$refs.toolPanel.style.top = `${this.lastScrollTop2}px`;
- } else if (curScrollTop - this.lastScrollTop < 0) {
+ } else if (curScrollTop - this.lastScrollTop <= 0) {
this.$refs.toolPanel.style.position = 'sticky';
this.$refs.toolPanel.style.top = 0;
this.lastScrollTop2 = curScrollTop;
}
- this.lastScrollTop = curScrollTop;
+ this.lastScrollTop = curScrollTop;
+ }
+
+ scrollToTop() {
+ this.$refs.scroller.scrollTop = 0;
+ const curScrollTop = this.$refs.scroller.scrollTop;
+ this.lastScrollTop = curScrollTop;
}
get foundAuthorsMessage() {
@@ -323,6 +311,7 @@ class Search {
this.searchResult = result;
await this.updateTableData();
+ this.scrollToTop();
} catch (e) {
this.$root.stdDialog.alert(e.message, 'Ошибка');
return;
diff --git a/client/components/share/NumInput.vue b/client/components/share/NumInput.vue
index 9cf2ed3..c0aab0a 100644
--- a/client/components/share/NumInput.vue
+++ b/client/components/share/NumInput.vue
@@ -12,7 +12,7 @@