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

Mejora vistas interactivas (detalle y otros)

Permite iniciar con widgets interactivos ocultos.
Mejora comportamiento al mostrar y ocultar elementos. Añade método para
recalcular orden según se ha definido.
Corrige elementos interactivos tras ocultar y volver a mostrar,
permitiendo interactuar como la primera vez.
parent b0427c41
Loading
Loading
Loading
Loading
+26 −4
Original line number Diff line number Diff line
@@ -140,6 +140,12 @@ define([

			this._createWidgetNode(key, config);

			if (config.hidden) {
				var dfd = new Deferred();
				dfd.resolve();
				return dfd;
			}

			return this._showWidget(key);
		},

@@ -158,7 +164,7 @@ define([
		_onControllerShown: function() {

			if (this._getShown()) {
				this.packery.reloadItems();
				this._reloadInteractive();
				this._updateInteractive();
			}

@@ -166,6 +172,12 @@ define([
			this._refreshModules();
		},

		_reloadInteractive: function() {

			this.packery.layout();
			this.packery.reloadItems();
		},

		_checkPathVariableId: function() {
			// TODO: este método es más propio de vista que de diseño, el diseño puede usarse a nivel más bajo que una vista

@@ -176,6 +188,7 @@ define([

		_onControllerMeOrAncestorShown: function(res) {

			this._reloadInteractive();
			this._updateInteractive();
		},

@@ -284,10 +297,14 @@ define([
				return;
			}

			this._once(instance.getChannel("HIDDEN"), lang.hitch(this, function(node) {
			this._once(instance.getChannel("HIDDEN"), lang.hitch(this, function(args) {

				put(node, "." + this.hiddenClass);
			}, node));
				put(args.node, "." + this.hiddenClass);
				this._removeWidgetInteractivity(args.key);
			}, {
				key: key,
				node: node
			}));

			this._publish(instance.getChannel("HIDE"), {
				node: node
@@ -337,6 +354,11 @@ define([
			return draggie;
		},

		_removeWidgetInteractivity: function(key) {

			delete this._nodesHandlers[key];
		},

		_subModuleResized: function() {

			this._updateInteractive();