Commit 8c019483 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige tests de Tree y avisos de código

parent 1bb9da6c
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -283,14 +283,15 @@ define([

			var formDef = declare([FormContainerImpl, _ListenModelHasChanged, _CreateKeypad]);

			this[obj.label + 'Form'] = instanceForm = new declare(formDef).extend(_Window)(obj.formConfig);
			var FormDefinition = declare(formDef).extend(_Window);
			this[obj.label + 'Form'] = instanceForm = new FormDefinition(obj.formConfig);

			this._createSubscriptionsForm(instanceForm, obj);
		},

		_createSubscriptionsForm: function(instanceForm, obj) {

			this._subscribe(instanceForm.getChannel("CANCELLED"), lang.hitch(this, function(res) {
			this._subscribe(instanceForm.getChannel("CANCELLED"), lang.hitch(this, function() {

				this._showBoxUser(obj.formConfig.targetSave ? obj.formConfig.targetSave : obj.formConfig.target);
			}));
@@ -351,14 +352,14 @@ define([
			this._once(this._widgets.userImage.getChannel("SHOWN"), lang.hitch(this, this._subUserImageShownOnce));
		},

		_subUserImageShownOnce: function(res) {
		_subUserImageShownOnce: function() {

			this._nodes.userImage.onclick = lang.hitch(this, this._tryToGoToEditImage);
		},

		_tryToGoToEditImage: function(evt) {

			var node = evt.target || evt.currentTarget,
			var node = evt.currentTarget || evt.target,
				nodeTagName = node.tagName,
				nodeAttribute = node.getAttribute('data-redmic-id');

@@ -383,7 +384,7 @@ define([
			});
		},

		_afterShow: function(request) {
		_afterShow: function() {

			this._setSubscription({
				channel : this._widgets.userData.getChannel("BUTTON_EVENT"),
+4 −5
Original line number Diff line number Diff line
@@ -25,15 +25,14 @@ define([
		_getClickTargets: function(event) {

			var targetPath = event.path || (event.composedPath && event.composedPath()) || [],
				currTarget = event.currentTarget || event.target,
				targets = [
					event.currentTarget.activeElement
					currTarget.activeElement
				];

			if (!targetPath.length) {
				var eventTarget = event.target || event.currentTarget,
					eventTargetParent = eventTarget.parentElement;

				targetPath.push(eventTarget, eventTargetParent);
				var currTargetParent = currTarget.parentElement;
				targetPath.push(currTarget, currTargetParent);
			}

			return targets.concat(targetPath);
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ define([
		_onSliderBrushStart: function(event) {

			var originalEvt = event.sourceEvent,
				evtNode = originalEvt ? originalEvt.currentTarget : null,
				evtNode = originalEvt ? originalEvt.currentTarget || originalEvt.target : null,
				sliderGroup = this.sliderBrushGroup.node();

			this._brushEventFromDescendant = sliderGroup && sliderGroup.contains(evtNode);
+25 −32
Original line number Diff line number Diff line
define([
	"dojo/_base/declare"
	, "dojo/_base/lang"
	, "RWidgets/Utilities"
	, "redmic/modules/base/_Module"
	, "redmic/modules/base/_Selection"
	, "redmic/modules/base/_Show"
@@ -9,7 +8,6 @@ define([
], function(
	declare
	, lang
	, Utilities
	, _Module
	, _Selection
	, _Show
@@ -26,7 +24,6 @@ define([
		//	config: Object
		//		Opciones y asignaciones por defecto.


		constructor: function(args) {

			this.config = {
@@ -110,30 +107,28 @@ define([

		_getParentValue: function(item) {

			if (!item[this.idProperty])
			if (!item[this.idProperty]) {
				return item[this.parentProperty];
			}

			var pathSplitted = item[this.idProperty].split(this.pathSeparator),
				parent;

			if (this.idProperty !== this.idProperty) {
				parent = pathSplitted[pathSplitted.length - 2];
				return !isNaN(parent) ? parent : null;
			} else {
			pathSplitted.pop();
			parent = pathSplitted.join(this.pathSeparator);
			return parent.indexOf(this.pathSeparator) < 0 ? null : parent;
			}
		},

		_getLabelValue: function(item) {

			if (typeof this.itemLabel === "function")
			if (typeof this.itemLabel === "function") {
				return this.itemLabel(item);
			}

			if (typeof this.itemLabel === "string") {
				if (this.itemLabel.indexOf("{") < 0)
				if (this.itemLabel.indexOf("{") < 0) {
					return item[this.itemLabel] || item[this.idProperty];
				}
				return lang.replace(this.itemLabel, item);
			}

@@ -144,10 +139,7 @@ define([

			var itemId = item[this.idProperty];

			if (this._selection[itemId] || this._isParentItemSelected(item))
				return true;

			return false;
			return this._selection[itemId] || this._isParentItemSelected(item);
		},

		_isParentItemSelected: function(item) {
@@ -155,16 +147,14 @@ define([
			var parentId = item[this.parentProperty],
				parentItem = this.getItem(parentId);

			if (parentItem && this.getChecked(parentItem) === true)
				return true;

			return false;
			return parentItem && this.getChecked(parentItem) === true;
		},

		_insertItemIntoStore: function(item) {

			if (!item)
			if (!item) {
				return;
			}

			if (!this.getItem(item[this.idProperty])) {
				this.putItem(item);
@@ -176,8 +166,9 @@ define([
			var item = this._obtainItem(itemId);
			itemId = this._obtainItemId(itemId);

			if (this._selection[itemId])
			if (this._selection[itemId]) {
				return;
			}

			this._selection[itemId] = true;

@@ -188,15 +179,19 @@ define([

		_obtainItem: function(itemId) {

			if (typeof itemId === "object")
			if (typeof itemId === "object") {
				return itemId;
			}

			return this.getItem(itemId);
		},

		_obtainItemId: function(itemId) {

			if (typeof itemId === "object")
			if (typeof itemId === "object") {
				return itemId[this.idProperty];
			}

			return itemId;
		},

@@ -208,15 +203,13 @@ define([
			delete this._selection[itemId];

			item && this.getChecked(item) && this.setChecked(item, false);

			/*if(!Object.keys(this._selection).length)
				this._emitEvt('CLEAR_SELECTION');*/
		},

		_pubRefreshed: function(channel) {

			clearTimeout(this._refreshedPublicationTimeoutHandler);
			this._refreshedPublicationTimeoutHandler = setTimeout(lang.hitch(this, function() {

				this._publish(channel, {
					success: true,
					target: this.target
@@ -227,10 +220,9 @@ define([
		_checkSelectedOrDeselected: function(evt) {

			var item = evt[0],
				node = evt[1],
				event = evt[2],
				itemId = item[this.idProperty],
				target = event.target || event.currentTarget,
				target = event.currentTarget || event.target,
				evtToEmit = target.checked ? 'SELECT' : 'DESELECT';

			this._emitEvt(evtToEmit, itemId);
@@ -246,8 +238,9 @@ define([

		_clearSelection: function() {

			for (var selectedItemId in this._selection)
			for (var selectedItemId in this._selection) {
				this._deselect(selectedItemId);
			}
		}
	});
});
+4 −4
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ define([
					item,
					'nodo',
					{
						srcElement: {
						currentTarget: {
							checked: true
						}
					}
@@ -228,7 +228,7 @@ define([
					item,
					'nodo',
					{
						srcElement: {
						currentTarget: {
							checked: false
						}
					}
@@ -611,7 +611,7 @@ define([
					item,
					'nodo',
					{
						srcElement: {
						currentTarget: {
							checked: true
						}
					}
@@ -718,7 +718,7 @@ define([
					item,
					'nodo',
					{
						srcElement: {
						currentTarget: {
							checked: false
						}
					}