client/search: go back to page 1 on query change
This commit is contained in:
parent
e4f9c26776
commit
5a152dbc0c
3 changed files with 5 additions and 4 deletions
|
@ -115,10 +115,9 @@ class PostsHeaderView extends events.EventTarget {
|
|||
if (this._masstagAutoCompleteControl) {
|
||||
this._masstagAutoCompleteControl.hide();
|
||||
}
|
||||
let parameters = {
|
||||
query: this._queryInputNode.value,
|
||||
page: this._ctx.parameters.page,
|
||||
};
|
||||
let parameters = {query: this._queryInputNode.value};
|
||||
parameters.page = parameters.query === this._ctx.parameters.query ?
|
||||
this._ctx.parameters.page : 1;
|
||||
if (this._massTagInputNode) {
|
||||
parameters.tag = this._massTagInputNode.value;
|
||||
this._massTagInputNode.blur();
|
||||
|
|
|
@ -38,6 +38,7 @@ class TagsHeaderView extends events.EventTarget {
|
|||
this._queryInputNode.blur();
|
||||
this.dispatchEvent(new CustomEvent('navigate', {detail: {parameters: {
|
||||
query: this._queryInputNode.value,
|
||||
page: 1,
|
||||
}}}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ class UsersHeaderView extends events.EventTarget {
|
|||
e.preventDefault();
|
||||
this.dispatchEvent(new CustomEvent('navigate', {detail: {parameters: {
|
||||
query: this._queryInputNode.value,
|
||||
page: 1,
|
||||
}}}));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue