mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
FIX: Don't bind events in defaultState
This commit is contained in:
parent
afe6f46b03
commit
be1cce503c
@ -62,6 +62,8 @@ const SiteHeaderComponent = MountWidget.extend(Docking, {
|
|||||||
|
|
||||||
this.dispatch('notifications:changed', 'user-notifications');
|
this.dispatch('notifications:changed', 'user-notifications');
|
||||||
this.dispatch('header:keyboard-trigger', 'header');
|
this.dispatch('header:keyboard-trigger', 'header');
|
||||||
|
this.dispatch('header:keyboard-trigger', 'header');
|
||||||
|
this.dispatch('search-autocomplete:after-complete', 'search-term');
|
||||||
|
|
||||||
this.appEvents.on('dom:clean', () => {
|
this.appEvents.on('dom:clean', () => {
|
||||||
// For performance, only trigger a re-render if any menu panels are visible
|
// For performance, only trigger a re-render if any menu panels are visible
|
||||||
|
@ -5,16 +5,16 @@ import { createWidget } from 'discourse/widgets/widget';
|
|||||||
createWidget('search-term', {
|
createWidget('search-term', {
|
||||||
tagName: 'input',
|
tagName: 'input',
|
||||||
buildId: () => 'search-term',
|
buildId: () => 'search-term',
|
||||||
buildKey: (attrs) => `search-term-${attrs.id}`,
|
buildKey: () => `search-term`,
|
||||||
|
|
||||||
defaultState() {
|
defaultState() {
|
||||||
this.appEvents.on("search-autocomplete:after-complete", () => {
|
|
||||||
this.state.afterAutocomplete = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
return { afterAutocomplete: false };
|
return { afterAutocomplete: false };
|
||||||
},
|
},
|
||||||
|
|
||||||
|
searchAutocompleteAfterComplete() {
|
||||||
|
this.state.afterAutocomplete = true;
|
||||||
|
},
|
||||||
|
|
||||||
buildAttributes(attrs) {
|
buildAttributes(attrs) {
|
||||||
return { type: 'text',
|
return { type: 'text',
|
||||||
value: attrs.value || '',
|
value: attrs.value || '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user