Commit 4bf2d7eb authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige gestión de Manager, elimina destroy doble

Los botones que gestiona Manager dentro de Topbar se quedaban en
cualquier vista, ya que al cambiar la estructura de canales no estaba
escuchando las publicaciones correctas.

Router ejecutaba el método destroy de los módulos innerApp y outerApp,
pero ya la propia implementación base de los módulos se encarga de
hacerlo, por lo que se omite.
parent 6ff9ecc1
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ define([
		constructor: function(args) {

			this.config = {
				ownChannel: 'app',
				ownChannel: this.rootChannel,
				events: {
					GET_CREDENTIALS: 'getCredentials',
					GET_MODULE: 'getModule',
@@ -468,7 +468,7 @@ define([

		_subAvailableModule: function(/*Object*/ instance) {
			//	summary:
			//		Se ejecuta este callback cuando recibe el modulo dedido
			//		Se ejecuta este callback cuando recibe el módulo pedido
			//	tags:
			//		private

@@ -571,7 +571,7 @@ define([

		_deleteLayout: function() {
			//	summary:
			//		Elimina el layout actual y lo manda a destruir tras ocultarse
			//		Oculta el layout actual
			//	tags:
			//		private

@@ -596,7 +596,6 @@ define([

		_onLayoutDestroyed: function() {

			this._currLayoutInstance.destroy();
			delete this._currLayoutInstance;
		},

+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ define([
			// TODO integrar manager con topbar, manager está desfasado casi por completo
			this._manager = new Manager({
				//parentChannel: this.getChannel()
				parentChannel: this.parentChannel
				parentChannel: this.getParentChannel()
			}, containerNode);
		},

+3 −5
Original line number Diff line number Diff line
@@ -4,13 +4,12 @@ define([
	, 'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'dojo/aspect'
	, "dojo/dom-class"
	, 'dojo/on'
	, 'dojo/dom-class'
	, 'put-selector/put'
	, 'redmic/base/Credentials'
	, 'redmic/modules/selection/Selector'
	, 'redmic/modules/components/Sidebar/MainSidebarImpl'
	, 'redmic/modules/notification/Notification'
	, 'redmic/modules/selection/Selector'
	, 'redmic/modules/socket/_IngestData'
	, 'redmic/modules/socket/_Report'
	, 'redmic/modules/socket/_Worms'
@@ -23,12 +22,11 @@ define([
	, lang
	, aspect
	, domClass
	, on
	, put
	, Credentials
	, Selector
	, MainSidebarImpl
	, Notification
	, Selector
	, _IngestData
	, _Report
	, _Worms
+11 −30
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@ define([
	"dijit/form/Button"
	, "dojo/_base/declare"
	, "dojo/_base/lang"
	, "dojo/dom-class"
	, "dojo/topic"
	, "put-selector/put"
	, "redmic/base/Credentials"
@@ -13,7 +12,6 @@ function(
	Button
	, declare
	, lang
	, domClass
	, topic
	, put
	, Credentials
@@ -225,21 +223,6 @@ function(
			}
		},

		_destroyManager: function() {
			//	summary:
			//		Destruye al Manager para que nadie más lo use.
			//	tags:
			//		private

			this.handlers.create.remove();
			this.handlers.location.remove();
			this.handlers.info.remove();

			this._cleanManager();

			this.destroyRecursive();
		},

		_createManager: function(showBtn) {

			for (var item in this.zones) {
@@ -273,13 +256,20 @@ function(
		},

		_chkChangeView: function(data, channel) {
			// TODO seguro que hay una manera mejor de limpiar Manager, revisar cuando se integre en Topbar

			var namespaceSplitted = this._getNamespaceSplitted(data, channel),
				action = namespaceSplitted.pop(),
				subPath = namespaceSplitted.pop();
				channelLength = namespaceSplitted.length;

			return (action === this.actions.SHOWN) && (namespaceSplitted.length === 1) &&
				(subPath.indexOf(this.viewSeparator) > -1);
			// Si el número de eslabones es distinto, la publicación no era de una vista
			if (channelLength !== 4) {
				return;
			}

			var action = namespaceSplitted[channelLength - 1],
				subPath = namespaceSplitted[channelLength - 2];

			return action === this.actions.SHOWN && subPath.indexOf(this.viewSeparator) !== -1;
		},

		_subChangeView: function(data, channel) {
@@ -313,15 +303,6 @@ function(
		_emitDownloadFile: function(/*String*/ format) {

			this._emitEvt('DOWNLOAD_FILE', {format: format});
		},

		_getRootChannel: function(/*String*/ channel, /*String?*/ action) {

			if (action) {
				channel += this.channelSeparator + action;
			}

			return "app" + this.channelSeparator + channel;
		}
	});