mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -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`,
|
||||
|
||||
defaultState() {
|
||||
return { searchVisible: false,
|
||||
hamburgerVisible: false,
|
||||
userVisible: false,
|
||||
contextEnabled: false,
|
||||
ringBackdrop: true };
|
||||
let states = {
|
||||
searchVisible: false,
|
||||
hamburgerVisible: false,
|
||||
userVisible: false,
|
||||
contextEnabled: false,
|
||||
ringBackdrop: true
|
||||
};
|
||||
|
||||
if (this.site.mobileView) {
|
||||
states.skipSearchContext = true;
|
||||
}
|
||||
|
||||
return states;
|
||||
},
|
||||
|
||||
html(attrs, state) {
|
||||
@ -227,7 +235,7 @@ export default createWidget('header', {
|
||||
var params = "";
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user