client/search: go back to page 1 on query change

This commit is contained in:
rr- 2016-08-28 23:08:29 +02:00
parent e4f9c26776
commit 5a152dbc0c
3 changed files with 5 additions and 4 deletions

View file

@ -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();

View file

@ -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,
}}}));
}
}

View file

@ -31,6 +31,7 @@ class UsersHeaderView extends events.EventTarget {
e.preventDefault();
this.dispatchEvent(new CustomEvent('navigate', {detail: {parameters: {
query: this._queryInputNode.value,
page: 1,
}}}));
}
}