From 33aada454020b612debbd1d0263d0cd20eb39569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Aragunde=20P=C3=A9rez?= Date: Mon, 31 Oct 2011 13:11:55 +0100 Subject: [PATCH] [Bug #1141] Added setter for left attribute of TaskComponent which updates the dependencies. FEA: ItEr75S04BugFixing --- .../resources/web/js/ganttz/TaskComponent.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js b/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js index 533654b37..09daa881c 100644 --- a/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js +++ b/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js @@ -60,7 +60,13 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, { $define :{ resourcesText : null, labelsText : null, - tooltipText : null + tooltipText : null, + left: function() { + this.$supers('setLeft', arguments); + this._getRelatedDependencies().forEach(function(dependency) { + dependency.draw(); + }); + } }, $init : function(){ this.$supers('$init', arguments); @@ -114,6 +120,14 @@ ganttz.TaskComponent = zk.$extends(zul.Widget, { consolidateNewDependency : function(task){ zAu.send(new zk.Event(this, 'onAddDependency', {dependencyId : task.id})); }, + _getRelatedDependencies: function() { + return jq('.dependency[idtaskorig='+ this.uuid + ']') + .add('.dependency[idtaskend='+ this.uuid + ']') + .get() + .map(function(dep) { + return ganttz.DependencyComponentBase.$(dep); + }); + }, _addDragDrop : function(){ var dragdropregion = this._getDragDropRegion(); var thisTaskId = this.$n().id;