changed behavior of ticker
[brisk.git] / web / ticker.js
index 9614087..e4362ff 100644 (file)
@@ -53,15 +53,17 @@ train.prototype = {
     deltas: 5,
     xend: 0,
     timout: null,
+    clickable: true,
 
     show: function()
     {
+        this.clickable = true;
         this.box.style.visibility = "visible";
     },
 
     hide: function()
     {
-        this.box.style.visibility = "hidden";
+        this.clickable = false;
         for (cur = this.first ; cur != null ; cur = cur.next) {
             if (cur.notebox != null) {
                 cur.cb_mouseout();
@@ -159,7 +161,7 @@ train.prototype = {
 
         if (this.first == null) {
             clearTimeout(this.timout);
-            // this.box.style.visibility = "hidden";            
+            this.timout = null;
         }
     },
 
@@ -244,20 +246,26 @@ train.prototype = {
     start: function()
     {
         this.resetx();
-        this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
+        if (this.timout == null) {
+            this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
+        }
     },
 
     animate: function()
     {
        this.box.style.left = (parseInt(this.box.style.left) - this.deltas)+"px";
-       if (parseInt(this.box.style.left) >= this.xend) {
-            this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
-        }
-        else {
-            // qui destroy
-            this.box.style.left = this.anc.offsetWidth+"px";
-            this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
-        }
+
+//        if (parseInt(this.box.style.left) >= this.xend) {
+//             this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
+//         }
+//         else {
+//             this.box.style.left = this.anc.offsetWidth+"px";
+//             this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
+//         }
+       if (parseInt(this.box.style.left) < this.xend) {
+           this.box.style.left = this.anc.offsetWidth+"px";
+       }
+       this.timout = setTimeout(function(obj){ obj.animate(); }, this.deltat, this);
     },
 
     widthbox_get: function()
@@ -355,7 +363,9 @@ wagon.prototype = {
 
     cb_click: function()
     { 
-        act_sitdown(this.table); 
+        if (this.anc.clickable == true) {
+            act_sitdown(this.table);
+        }
     },
 
     cb_mouseover: function()