Commit 361937bb authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Comienza limpieza de contenedores Dijit

Revisa diseños, añadiendo base de layout para todos.
Empieza probando los cambios con el producto de Atlas.
Omite funcionalidades de módulos que dejarán de ser necesarias.
parent a823e81b
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@ define([
				},
				actions: {
					SHOW_MODULE: 'showModule',
					MODULE_SHOWN: 'moduleShown',
					WINDOW_RESIZE: 'windowResize'
					MODULE_SHOWN: 'moduleShown'
				}
			};

@@ -43,9 +42,9 @@ define([
			this.subscriptionsConfig.push({
				channel: this.getChannel('SHOW_MODULE'),
				callback: '_subShowModule'
			},{
			/*},{
				channel: this.getChannel('RESIZE_VIEW'),
				callback: '_subResizeView'
				callback: '_subResizeView'*/
			});
		},

@@ -62,7 +61,10 @@ define([

		_doEvtFacade: function() {

			this._getGlobalContext().onresize = lang.hitch(this, this._groupEventArgs, 'WINDOW_RESIZE');
			// TODO puede que no sea necesario, se puede eliminar de aquí y de '_Show' si no se va a usar,
			// o bien implementarse directamente en _Show sin necesidad de publicar (todos los módulos pueden acceder
			// al elemento window)
			//this._getGlobalContext().onresize = lang.hitch(this, this._groupEventArgs, 'WINDOW_RESIZE');
		},

		_setOwnCallbacksForEvents: function() {
@@ -86,10 +88,10 @@ define([
			}
		},

		_subResizeView: function(req) {
		/*_subResizeView: function(req) {

			this._doResize();
		},
		},*/

		_subShowModule: function(req) {

@@ -106,7 +108,8 @@ define([

		_onModuleShown: function(moduleKey, res) {

			this._doResize();
			// TODO cuando no sea contenedor dijit, no hará falta
			//this._doResize();

			this._emitEvt('MODULE_SHOWN', {
				key: moduleKey
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ define([
	, _ListenRequestError
	, _ViewHandle	// QUITAR
){
	return declare([_ListenRequestError, _ViewHandle, ContentPane, _Module, _Show], {
	return declare([_ListenRequestError, _ViewHandle/*, ContentPane*/, _Module, _Show], {
		//	summary:
		//		Base común para todas los módulos usados como vistas.

+1 −0
Original line number Diff line number Diff line
@@ -319,6 +319,7 @@ define([
			var dfd = new Deferred();

			require(["app" + moduleItem.internPath + "View"], lang.hitch(this, function(ModuleView) {

				// Creamos el módulo
				var moduleInstance = new ModuleView({
					perms: moduleItem.perms,
+68 −0
Original line number Diff line number Diff line
define([
	'dojo/_base/declare'
	, 'dojo/_base/lang'
	, 'put-selector/put'
	, './_LayoutItfc'
], function(
	declare
	, lang
	, put
	, _LayoutItfc
) {

	return declare(_LayoutItfc, {
		//	summary:
		//		Base para los layout.

		constructor: function(args) {

			this.config = {
				layoutClass: 'designLayoutContainer'
			};

			lang.mixin(this, this.config, args);
		},

		postCreate: function() {

			this.inherited(arguments);

			this._createLayoutContainer();
		},

		_createLayoutContainer: function() {

			var classNames = this.layoutClass;

			if (this.layoutAdditionalClasses) {
				classNames += ' ' + this.layoutAdditionalClasses;
			}

			classNames = classNames.replace(/\ /g, '.');
			this._layoutContainer = put('div.' + classNames);
		},

		_addNodeToLayout: function(child) {

			if (!child) {
				console.error('Tried to add invalid child to layout: "%s"', this.getChannel());
				return;
			}

			var childNode = child.domNode || child;

			put(this._layoutContainer, childNode);
		},

		// TODO sustituto de método de dijit, cuando se resuelvan todas las dependencias, eliminar y usar el interno
		addChild: function(child) {

			this._addNodeToLayout(child);
		},

		_getNodeToShow: function() {

			return this._layoutContainer;
		}
	});
});
+23 −0
Original line number Diff line number Diff line
define([
	"dojo/_base/declare"
	, "dojo/_base/lang"
	, "redmic/modules/base/_Itfc"
], function(
	declare
	, lang
	, _Itfc
){
	return declare(_Itfc, {
		//	summary:
		//		Interfaz de _Layout.
		//	description:
		//		Define los métodos que debe poseer el módulo o la implementación.


		_getMethodsToImplement: function() {

			return lang.mixin(this.inherited(arguments), {
			});
		}
	});
});
Loading