Доделки поиска текста

This commit is contained in:
Book Pauk
2019-02-02 19:59:14 +07:00
parent 98fd921f98
commit 6a7283db5a
3 changed files with 82 additions and 12 deletions

View File

@@ -130,7 +130,13 @@ class SearchPage extends Vue {
this.foundCur = next;
else
this.foundCur = (this.foundList.length ? 0 : -1);
this.$emit('book-pos-changed', {bookPos: this.foundList[this.foundCur]});
if (this.foundCur >= 0) {
this.$emit('start-text-search', {needle: this.needle.toLowerCase()});
this.$emit('book-pos-changed', {bookPos: this.foundList[this.foundCur]});
} else {
this.$emit('stop-text-search');
}
this.$refs.input.focus();
}
@@ -140,7 +146,13 @@ class SearchPage extends Vue {
this.foundCur = prev;
else
this.foundCur = this.foundList.length - 1;
this.$emit('book-pos-changed', {bookPos: this.foundList[this.foundCur]});
if (this.foundCur >= 0) {
this.$emit('start-text-search', {needle: this.needle.toLowerCase()});
this.$emit('book-pos-changed', {bookPos: this.foundList[this.foundCur]});
} else {
this.$emit('stop-text-search');
}
this.$refs.input.focus();
}