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

Controla bugs con botones de ventanas

Comprueba si los botones existen antes de actualizarlos, para casos en
los que la ventana omita su creación.
parent a4c84991
Loading
Loading
Loading
Loading
+18 −6
Original line number Diff line number Diff line
@@ -354,7 +354,9 @@ define([

			this._resizeAfterMinimizeToggle();

			if (this._minimizeButton) {
				this._minimizeButton.onclick = lang.hitch(this, this._minimizeModuleReturn);
			}

			if (this.resizable) {
				domClass.add(this._resizeHandleNode, this.hiddenClass);
@@ -368,7 +370,9 @@ define([

			this._resizeAfterMinimizeToggle();

			if (this._minimizeButton) {
				this._minimizeButton.onclick = lang.hitch(this, this._minimizeModule);
			}

			if (this.resizable) {
				domClass.remove(this._resizeHandleNode, this.hiddenClass);
@@ -392,8 +396,10 @@ define([

			this._resizeAfterMaximizeToggle();

			if (this._maximizeButton) {
				this._maximizeButton.onclick = lang.hitch(this, this._maximizeModuleReturn);
				this._updateMaximizeButtonIcon(true);
			}

			domAttr.set(this._windowNode.parentNode, this.widthByColsAttr, this.maxWidthCols);

@@ -404,14 +410,20 @@ define([

			this._resizeAfterMaximizeToggle();

			if (this._maximizeButton) {
				this._maximizeButton.onclick = lang.hitch(this, this._maximizeModule);
				this._updateMaximizeButtonIcon(false);
			}

			domAttr.set(this._windowNode.parentNode, this.widthByColsAttr, this._originalWidthByCols);
		},

		_prepareMaximizeForUndoUserResize: function() {

			if (!this._maximizeButton) {
				return;
			}

			this._maximizeButton.onclick = lang.hitch(this, this._undoUserResize);
			this._updateMaximizeButtonIcon(true);
		},