mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Store skipSearchContext in state for plugins to extend.
This commit is contained in:
parent
ed4fecb152
commit
12b175db59
@ -169,11 +169,19 @@ export default createWidget('header', {
|
|||||||
buildKey: () => `header`,
|
buildKey: () => `header`,
|
||||||
|
|
||||||
defaultState() {
|
defaultState() {
|
||||||
return { searchVisible: false,
|
let states = {
|
||||||
hamburgerVisible: false,
|
searchVisible: false,
|
||||||
userVisible: false,
|
hamburgerVisible: false,
|
||||||
contextEnabled: false,
|
userVisible: false,
|
||||||
ringBackdrop: true };
|
contextEnabled: false,
|
||||||
|
ringBackdrop: true
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.site.mobileView) {
|
||||||
|
states.skipSearchContext = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return states;
|
||||||
},
|
},
|
||||||
|
|
||||||
html(attrs, state) {
|
html(attrs, state) {
|
||||||
@ -227,7 +235,7 @@ export default createWidget('header', {
|
|||||||
var params = "";
|
var params = "";
|
||||||
|
|
||||||
if (context) {
|
if (context) {
|
||||||
params = `?context=${context.type}&context_id=${context.id}&skip_context=true`;
|
params = `?context=${context.type}&context_id=${context.id}&skip_context=${this.state.skipSearchContext}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DiscourseURL.routeTo('/search' + params);
|
return DiscourseURL.routeTo('/search' + params);
|
||||||
|
Loading…
Reference in New Issue
Block a user