tasks_list object created without 'clip' object
authorMatteo Nastasi <matteo.nastasi@lucinilucini.com>
Fri, 11 Nov 2011 18:04:31 +0000 (19:04 +0100)
committerMatteo Nastasi <matteo.nastasi@lucinilucini.com>
Fri, 11 Nov 2011 18:04:31 +0000 (19:04 +0100)
mplanner.html
xynt-link.js

index 2fc0ef3..88d0ab8 100644 (file)
@@ -40,7 +40,7 @@ window.onload = function () {
     Drag.init($('r1'), dropr1, $('r1'), 0,0, -900,900);
     Drag.init($('r2'), dropr2, $('r2'), 0,0, -900,900);
 
-   l = new tasks_link($('lnk1'), $('board'), $('t1'), $('t2'), "ss");
+   l = new tasks_link($('board'), $('t1'), $('t2'), "ss");
 
 }
 </script>
index da15cbe..3838372 100644 (file)
@@ -1,12 +1,17 @@
-function tasks_link(o, anc, a, b, type) {
+function tasks_link(anc, a, b, type) {
     var cur;
-    this.o = o;
     this.anc = anc;
+    this.o   = document.createElement("div");
+    this.o.style.top  = "0px";
+    this.o.style.left = "0px";
+    this.o.style.position = "absolute";
+    this.o.style.visibility = "hidden";
     this.beg = document.createElement("div");
     this.end = document.createElement("div");
     this.arr = document.createElement("img");
     this.arr.style.position = "absolute";
-    o.appendChild(this.arr);
+    this.o.appendChild(this.arr);
+    this.anc.appendChild(this.o);
     for (var i = 0 ; i < 2 ; i++) {
         cur = i == 0 ? this.beg : this.end;
         cur.style.width = '5px';
@@ -15,7 +20,7 @@ function tasks_link(o, anc, a, b, type) {
         cur.style.visibility = 'inherit';
         cur.style.zIndex = 20;
         cur.style.position = 'absolute';
-        o.appendChild(cur);
+        this.o.appendChild(cur);
         // alert("gugu");
     }