Commit 58bf3684 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Actualiza botones de vista detalle al cambiar item

parent 90c90763
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ define([

			this._titleButtonsNode = put(this.topNode, 'div.buttons');
			this._titleLeftNode = put(this._titleButtonsNode, "div.left");
			this._titleRightNode = put(this._titleButtonsNode, "div.right.hidden");
			this._titleRightNode = put(this._titleButtonsNode, "div.right");
		},

		_addIdTitle: function() {
@@ -172,26 +172,28 @@ define([

			var i;

			if (this._titleLeftNode.children.length === 0) {
			if (this._titleLeftNode.children.length !== 0) {
				for (i = 0; i < this._titleLeftNode.children.length; i++) {
					put('!', this._titleLeftNode.children[i]);
				}
			}
			for (i = 0; i < leftButtons.length; i++) {
				this._preInsertIcon(leftButtons[i], this._titleLeftNode);
			}
			}

			if (this._titleRightNode.children.length === 0) {
				if (rightButtons.length !== 0) {
					this._titleRightNode.setAttribute("class", "right");
			if (this._titleRightNode.children.length !== 0) {
				for (i = 0; i < this._titleRightNode.children.length; i++) {
					put('!', this._titleRightNode.children[i]);
				}
			}

			for (i = 0; i < rightButtons.length; i++) {
				this._preInsertIcon(rightButtons[i], this._titleRightNode);
			}
			}
		},

		_preInsertIcon: function(buttonProp, node) {

			if ((!buttonProp.condition) || (buttonProp.condition && this.data && this.data[buttonProp.condition])) {
			if (!buttonProp.condition || (this.data && this.data[buttonProp.condition])) {
				this._insertIcon(buttonProp, node);
			}
		},