Commit b10b6a72 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Sincroniza filtros entre widgets de búsqueda

parent de358115
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ define([
			this.config = {
				noScroll: true,
				propsWidget: {
					omitTitleButtons: true
				}
			};

@@ -153,9 +152,18 @@ define([

		_showSearchResults: function(searchDefinition) {

			var obj = {
				target: searchDefinition.target,
				queryChannel: searchDefinition.queryChannel
			};

			this._publish(this._widgets.searchResults.getChannel('SET_PROPS'), obj);
			this._publish(this._widgets.searchFastFilter.getChannel('SET_PROPS'), obj);

			this._showWidget('searchFastFilter');
			this._showWidget('searchResults');
			this._reloadInteractive();
			this._updateInteractive();

			this._publish(this._widgets.searchResults.getChannel('SEARCH_DATA'), searchDefinition);
		},
@@ -170,9 +178,15 @@ define([
			this._updateInteractive();
		},

		_toggleAdvancedSearch: function() {
		_toggleAdvancedSearch: function(searchDefinition) {

			if (!this._advancedSearchShown) {
				if (this._advancedSearchShown === undefined) {
					this._publish(this._widgets.searchFilter.getChannel('SET_PROPS'), {
						target: searchDefinition.target,
						queryChannel: searchDefinition.queryChannel
					});
				}
				this._advancedSearchShown = true;
				this._showWidget('searchFilter');
				this._reloadInteractive();
+6 −2
Original line number Diff line number Diff line
@@ -75,7 +75,10 @@ define([

			var parentNode = put(this.contentNode, 'div.' + this.className);
			this._toggleAdvancedNode = put(this.contentNode, 'i.fa.fa-info');
			this._toggleAdvancedNode.onclick = lang.hitch(this, this._emitEvt, 'TOGGLE_ADVANCED_SEARCH');
			this._toggleAdvancedNode.onclick = lang.hitch(this, this._emitEvt, 'TOGGLE_ADVANCED_SEARCH', {
				target: this.target,
				queryChannel: this.queryChannel
			});

			this._publish(this.textSearch.getChannel("SHOW"), {
				node: parentNode
@@ -99,7 +102,8 @@ define([

			this._emitEvt('SHOW_SEARCH_RESULTS', {
				target: this.target,
				searchText: searchText
				searchText: searchText,
				queryChannel: this.queryChannel
			});
		}
	});
+4 −4
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ define([
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'put-selector/put'
	, 'redmic/modules/base/_Filter'
	, 'redmic/modules/base/_Module'
	, 'redmic/modules/base/_Show'
	, 'redmic/modules/base/_Store'
@@ -15,14 +14,13 @@ define([
	, declare
	, lang
	, put
	, _Filter
	, _Module
	, _Show
	, _Store
	, FacetsImpl
) {

	return declare([_Module, _Show, _Filter], {
	return declare([_Module, _Show], {
		//	summary:
		//		Widget contenedor de resultados de búsqueda sobre actividades

@@ -37,7 +35,7 @@ define([
			lang.mixin(this, this.config, args);
		},

		_initialize: function() {
		_createModules: function() {

			this.facetsSearchConfig = this._merge([{
				parentChannel: this.getChannel(),
@@ -68,6 +66,8 @@ define([
				return;
			}

			this._createModules();

			var facetsSearchNode = put(this.domNode, 'div.' + this.className);

			this._publish(this.facetsSearch.getChannel("SHOW"), {
+4 −4
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ define([
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'put-selector/put'
	, 'redmic/modules/base/_Filter'
	, 'redmic/modules/base/_Module'
	, 'redmic/modules/base/_Show'
	, 'redmic/modules/base/_Store'
@@ -15,14 +14,13 @@ define([
	, declare
	, lang
	, put
	, _Filter
	, _Module
	, _Show
	, _Store
	, CompositeImpl
) {

	return declare([_Module, _Show, _Filter], {
	return declare([_Module, _Show], {
		//	summary:
		//		Widget contenedor de resultados de búsqueda sobre actividades

@@ -37,7 +35,7 @@ define([
			lang.mixin(this, this.config, args);
		},

		_initialize: function() {
		_createModules: function() {

			this.compositeSearchConfig = this._merge([{
				parentChannel: this.getChannel(),
@@ -53,6 +51,8 @@ define([
				return;
			}

			this._createModules();

			var compositeSearchNode = put(this.domNode, 'div.' + this.className);

			this._publish(this.compositeSearch.getChannel("SHOW"), {
+9 −13
Original line number Diff line number Diff line
@@ -4,9 +4,7 @@ define([
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'put-selector/put'
	, 'redmic/modules/base/_Filter'
	, 'redmic/modules/base/_Store'
	, 'redmic/modules/browser/bars/Pagination'
	, 'redmic/modules/browser/bars/Total'
	, 'redmic/modules/browser/_ButtonsInRow'
	, 'redmic/modules/browser/_Framework'
@@ -18,9 +16,7 @@ define([
	, declare
	, lang
	, put
	, _Filter
	, _Store
	, Pagination
	, Total
	, _ButtonsInRow
	, _Framework
@@ -28,7 +24,7 @@ define([
	, ActivityList
) {

	return declare([_DashboardItem, _Store, _Filter], {
	return declare([_DashboardItem, _Store], {
		//	summary:
		//		Widget contenedor de resultados de búsqueda sobre actividades

@@ -47,16 +43,15 @@ define([
			lang.mixin(this, this.config, args);
		},

		_initialize: function() {
		_createModules: function() {

			this.browserConfig = this._merge([{
				parentChannel: this.getChannel(),
				target: this.target,
				queryChannel: this.queryChannel,
				template: ActivityList,
				bars: [{
					instance: Total
				},{
					instance: Pagination
				}],
				rowConfig: {
					buttonsConfig: {
@@ -88,6 +83,7 @@ define([
		_afterShow: function() {

			if (!this._getPreviouslyShown()) {
				this._createModules();
				// TODO retocar contenedores de por encima, igual no extender de la base de ahora
				put(this.containerNode, '.flex');
				this._browserNode = put(this.containerNode, 'div.' + this.className);
@@ -106,7 +102,7 @@ define([
						text: req.searchText
					}
				},
				requesterId: this.getOwnChannel()
				//requesterId: this.getOwnChannel()
			});
		},