Commit 707d5d9a authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Mejora gestión de cierre de sugerencias

Evita el cierre del bloque de sugerencias cuando el scroll se produce en
el propio bloque.

Fuerza el cierre del bloque de sugerencias cuando se oculta el
componente o alguno de sus ancestros (como en cambio de vista).
parent 33b82402
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -38,6 +38,13 @@ define([
			this.inherited(arguments);
		},

		_setOwnCallbacksForEvents: function() {

			this.inherited(arguments);

			this._onEvt('ME_OR_ANCESTOR_HIDDEN', () => this._closeSuggestionsContainer());
		},

		postCreate: function() {

			this.inherited(arguments);
@@ -341,6 +348,10 @@ define([

		_onGlobalScrollEvent: function(evt) {

			if (evt.target === this._suggestionsContainer) {
				return;
			}

			this._closeSuggestionsContainer();
		},

+9 −6
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ define([
	, 'src/component/base/_Module'
	, 'src/component/base/_Show'
	, 'src/component/layout/dataDisplayer/DataDisplayer'
	, 'src/component/search/TextImpl'
	, 'src/component/textSearch/TextSearchSuggestionsExpansionRequestImpl'
], function(
	redmicConfig
	, declare
@@ -15,7 +15,7 @@ define([
	, _Module
	, _Show
	, DataDisplayer
	, TextImpl
	, TextSearchSuggestionsExpansionRequestImpl
) {

	return declare([_Module, _Show, _Filter], {
@@ -51,12 +51,15 @@ define([
			this.textSearchConfig = this._merge([{
				parentChannel: this.getChannel(),
				target: this.target,
				queryChannel: this.queryChannel,
				legacyMode: false,
				showExpandIcon: true
				suggestionsRequestMethod: 'POST',
				suggestionsTarget: `${this.target}/_suggest`,
				getSuggestionsQueryParams: value => ({suggest: {text: value}})
				//queryChannel: this.queryChannel,
				//legacyMode: false,
				//showExpandIcon: true
			}, this.textSearchConfig || {}]);

			this.textSearch = new TextImpl(this.textSearchConfig);
			this.textSearch = new TextSearchSuggestionsExpansionRequestImpl(this.textSearchConfig);

			this._infoInstance = new DataDisplayer({
				parentChannel: this.getChannel(),