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

Corrige actualización de leyenda de gráficas

parent 19a27404
Loading
Loading
Loading
Loading
+18 −11
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ define([

		_initialize: function() {

			this.chartsList = new declare([ListLayout, ListController])({
			var ListDesignDefinition = declare([ListLayout, ListController]);
			this.chartsList = new ListDesignDefinition({
				parentChannel: this.getChannel(),
				title: this.i18n.selectedLayers,
				target: this._localTarget,
@@ -114,7 +115,8 @@ define([
				}
			});

			this.listMenu = new declare(ListMenu).extend(_ShowInTooltip)({
			var ListMenuDefinition = declare(ListMenu).extend(_ShowInTooltip);
			this.listMenu = new ListMenuDefinition({
				classTooltip: "tooltipButtonMenu tooltipButtonAggrement",
				parentChannel: this.getChannel(),
				select: {
@@ -132,7 +134,8 @@ define([
				}]
			});

			this._colorPicker = new declare(ColorPickerImpl).extend(_ShowInTooltip)({
			var ColorPickerDefinition = declare(ColorPickerImpl).extend(_ShowInTooltip);
			this._colorPicker = new ColorPickerDefinition({
				parentChannel: this.getChannel(),
				idProperty: this.idProperty,
				propertyName: "colorPicker",
@@ -236,14 +239,16 @@ define([

		_subGotLayerInfo: function(res) {

			var layerId = res.chart;

			this._updateLegendContentWithNewInfo(res);
			this._deactivateHiddenLayer(this._pathsByLayerId[layerId]);
			this._onLayerInfoUpdate(res);
		},

		_subLayerInfoUpdated: function(res) {

			this._onLayerInfoUpdate(res);
		},

		_onLayerInfoUpdate: function(res) {

			var layerId = res.chart;

			this._updateLegendContentWithNewInfo(res);
@@ -406,8 +411,10 @@ define([

		_addDataToBrowser: function(data) {

			var dataToAdd = this._getDataToAddToBrowser(data) || data;

			this._emitEvt("INJECT_DATA", {
				data: data,
				data: dataToAdd,
				target: this._localTarget
			});
		},
@@ -524,13 +531,13 @@ define([
				return;
			}

			var itemContentUpdate = {
			lang.mixin(this._currentData[layerPath], {
				path: layerPath,
				label: label
			};
			});

			this._emitEvt("INJECT_ITEM", {
				data: itemContentUpdate,
				data: this._currentData[layerPath],
				target: this._localTarget
			});
		},
+7 −11
Original line number Diff line number Diff line
define([
	"dojo/_base/declare"
	, "dojo/_base/lang"
	, "dojo/aspect"
	, "redmic/modules/chart/SmartLegend/SmartLegend"
	, "RWidgets/Utilities"
	, "templates/ChartListHierarchical"
@@ -9,12 +8,12 @@ define([
], function(
	declare
	, lang
	, aspect
	, SmartLegend
	, Utilities
	, HierarchicalTemplate
	, NonHierarchicalTemplate
) {

	return declare(SmartLegend, {
		//	summary:
		//		Implementación de SmartLegend para representar información sobre capas basadas en
@@ -32,8 +31,9 @@ define([

		_getAncestorLabel: function(ancestorData) {

			if (Utilities.isValidNumber(ancestorData.z))
			if (Utilities.isValidNumber(ancestorData.z)) {
				return ancestorData.z;
			}

			return ancestorData.name;
		},
@@ -48,20 +48,18 @@ define([
			return NonHierarchicalTemplate;
		},

		_addDataToBrowser: function(data) {
		_getDataToAddToBrowser: function(data) {

			if (this._currentIndex !== "noGrouped") {

				data = this._removeDefinitionIdsFromPaths(lang.clone(data));
				return this._removeDefinitionIdsFromPaths(data);
			}

			this.inherited(arguments);
			return data;
		},

		_removeDefinitionIdsFromPaths: function(data) {

			for (var i = 0; i < data.length; i++) {

				var item = data[i],
					itemPath = item.path;

@@ -76,7 +74,6 @@ define([
			var pathSplitted = itemPath.split(this.pathSeparator);

			if (pathSplitted.length > this._specificPathLengthLimit) {

				pathSplitted.splice(this._specificPathLengthLimit, 1);
				return pathSplitted.join(this.pathSeparator);
			}
@@ -89,7 +86,6 @@ define([
			var layerId = pubObj.layerId;

			if (this._layerIdByPseudonym[layerId]) {

				var colorIndex = pubObj.layerId.split(this._pseudonymSeparator).pop();
				pubObj.colorIndex = parseInt(colorIndex, 10);
				pubObj.layerId = this._layerIdByPseudonym[layerId];
+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ define([
				"_getHierarchicalTemplate": {},
				"_getNonHierarchicalTemplate": {},
				"_cleanLayerPath": {},
				"_getPubToLayerObj": {}
				"_getPubToLayerObj": {},
				"_getDataToAddToBrowser": {}
			});
		}
	});