diff --git a/ganttzk/src/main/resources/web/js/ganttz/DependencyComponent.js b/ganttzk/src/main/resources/web/js/ganttz/DependencyComponent.js index 9885fba12..0452589c1 100644 --- a/ganttzk/src/main/resources/web/js/ganttz/DependencyComponent.js +++ b/ganttzk/src/main/resources/web/js/ganttz/DependencyComponent.js @@ -277,14 +277,21 @@ ganttz.DependencyComponent = zk.$extends(ganttz.DependencyComponentBase,{ },{}); ganttz.UnlinkedDependencyComponent = zk.$extends(ganttz.DependencyComponentBase,{ - bind_ : function(){ - this.$supers('bind_', arguments); + $init : function(){ + this.$supers('$init', arguments); this._DOMlisttasks = jq('#listtasks'); this._DOMlistdependencies = jq('#listdependencies'); this._WGTganttpanel = ganttz.GanttPanel.getInstance(); - + }, + bind_ : function(){ + this.$supers('bind_', arguments); this._updateArrow(); }, + unbind_ : function(){ + this.domUnlisten_(this._WGTganttpanel.$n(), 'onMousemove', '_updateArrow'); + this.domUnlisten_(this._WGTganttpanel.$n(), 'onClick', '_consolidateDependency'); + this.$supers('unbind_', arguments); + }, draw : function(){ this.domListen_(this._WGTganttpanel.$n(), 'onMousemove', '_updateArrow'); this.domListen_(this._WGTganttpanel.$n(), 'onClick', '_consolidateDependency'); @@ -314,7 +321,7 @@ ganttz.UnlinkedDependencyComponent = zk.$extends(ganttz.DependencyComponentBase, + Math.max(0, this._DOMorigin.outerWidth() - ganttz.TaskComponent.CORNER_WIDTH); -coordOrigin.top = coordOrigin.top - this._DOMlisttasks.position().top + + coordOrigin.top = coordOrigin.top - this._DOMlisttasks.position().top + this._DOMlistdependencies.position().top + ganttz.TaskComponent.HEIGHT; diff --git a/ganttzk/src/main/resources/web/js/ganttz/DependencyList.js b/ganttzk/src/main/resources/web/js/ganttz/DependencyList.js index ac9c9e1fb..6ef8f3403 100644 --- a/ganttzk/src/main/resources/web/js/ganttz/DependencyList.js +++ b/ganttzk/src/main/resources/web/js/ganttz/DependencyList.js @@ -4,11 +4,6 @@ ganttz.DependencyList = zk.$extends(zk.Widget, { $init : function(){ this.$supers('$init', arguments); this.$class.setInstance(this); - }, - appendChild : function(child){ - //true for ignoring DOM insertion - this.$supers('appendChild',[child,true]); - jq('#listdependencies').append(child); } },{ setInstance : function(instance){ diff --git a/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js b/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js index d2198e9de..759341595 100644 --- a/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js +++ b/ganttzk/src/main/resources/web/js/ganttz/TaskComponent.js @@ -25,8 +25,8 @@ ganttz.TaskComponent = zk.$extends(zk.Widget, { var unlinkedDependency = new ganttz.UnlinkedDependencyComponent(); unlinkedDependency.setOrigin(this.$n()); - dependencylist.appendChild(unlinkedDependency); - dependencylist.rerender(); + WGTdependencylist.appendChild(unlinkedDependency, true); + WGTdependencylist.rerender(); unlinkedDependency.draw(); },