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 = {
|
||||||
|
searchVisible: false,
|
||||||
hamburgerVisible: false,
|
hamburgerVisible: false,
|
||||||
userVisible: false,
|
userVisible: false,
|
||||||
contextEnabled: false,
|
contextEnabled: false,
|
||||||
ringBackdrop: true };
|
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