[Bug #1141] Added setter for left attribute of TaskComponent which updates the dependencies.

FEA: ItEr75S04BugFixing
This commit is contained in:
Jacobo Aragunde Pérez 2011-10-31 13:11:55 +01:00
parent 5411f35444
commit 33aada4540

View file

@ -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;