Commit 6d97186e authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Redibuja módulos con método layout tras resize

Aquellos módulos con contenedores heredados de Dojo y que tienen método
layout para representarse, ahora también se reevaluan al recibir un
evento de redimensión. Ojo, las gráficas lineales tienen un problema con
esto, hay que revisar su implementación de resize.

Cancela emisión reiterativa de evento resize en módulos con ventana.
Solo se emite uno en un lapso de 100ms por defecto.
parent f57f10d4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ define([
			this._onEvt('HIDE', lang.hitch(this, this._onModuleHide));
			this._onEvt('ANCESTOR_SHOW', lang.hitch(this, this._prepareOnMeOrAncestorShown));
			this._onEvt('ANCESTOR_HIDE', lang.hitch(this, this._restoreOnMeOrAncestorShown));
			this._onEvt('RESIZE', lang.hitch(this, this._onModuleResize));
		},

		_showBeforePostCreate: function() {
@@ -774,6 +775,13 @@ define([
			this._propagateActionToChildren('ANCESTOR_HIDDEN', response);
		},

		_onModuleResize: function(evt) {

			if (this.layout) {
				this.layout();
			}
		},

		_getStartupStatus: function() {

			return this.statusFlags.started;
+16 −8
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ define([
		_resizableForcedMinWidth: 100,
		_validSizeInterval: 100,
		_userResizeTimeout: 100,
		_emitResizeTimeout: 100,

		_setShowOwnCallbacksForEvents: function () {

@@ -67,7 +68,7 @@ define([

		_onWindowAncestorShown: function() {

			this._emitResize();
			this._prepareToEmitResize();
		},

		_beforeShow: function(req) {
@@ -198,7 +199,8 @@ define([
			}

			clearTimeout(self._userResizeTimeoutHandler);
			self._userResizeTimeoutHandler = setTimeout(lang.hitch(self, self._emitResize), self._userResizeTimeout);
			self._userResizeTimeoutHandler = setTimeout(lang.hitch(self, self._prepareToEmitResize),
				self._userResizeTimeout);
		},

		_onWindowResizeProgressFirstUpdate: function() {
@@ -257,7 +259,7 @@ define([
		_onWindowValidSize: function() {

			this._emitEvt('LOADED');
			this._emitResize();
			this._prepareToEmitResize();
		},

		_decorateTitleNode: function() {
@@ -316,7 +318,7 @@ define([
			}

			this._minimizeDfd = new Deferred();
			this._minimizeDfd.then(lang.hitch(this, this._emitResize), function() {});
			this._minimizeDfd.then(lang.hitch(this, this._prepareToEmitResize), function() {});
		},

		_maximizeModule: function() {
@@ -355,7 +357,7 @@ define([
			domClass.remove(this._windowNode.parentNode, this.windowResizedParentClass);

			this._setResizedByUser(false);
			this._emitResize();
			this._prepareToEmitResize();

			this._maximizeModuleReturn();
		},
@@ -367,7 +369,7 @@ define([
			}

			this._maximizeDfd = new Deferred();
			this._maximizeDfd.then(lang.hitch(this, this._emitResize), function() {});
			this._maximizeDfd.then(lang.hitch(this, this._prepareToEmitResize), function() {});
		},

		_updateMaximizeButtonIcon: function(/*Boolean*/ altIcon) {
@@ -390,16 +392,22 @@ define([

			domStyle.set(this._windowNode.parentNode, "display", "none");

			this._emitResize();
			this._prepareToEmitResize();
		},

		_resize: function() {

			this._emitResize();
			this._prepareToEmitResize();

			this.inherited(arguments);
		},

		_prepareToEmitResize: function() {

			clearTimeout(this._emitResizeTimeoutHandler);
			this._emitResizeTimeoutHandler = setTimeout(lang.hitch(this, this._emitResize), this._emitResizeTimeout);
		},

		_emitResize: function() {

			if (!this.node) {