ux/FlipCounter.js
[roojs1] / ux / FlipCounter.js
index 6df2667..1b7d033 100644 (file)
@@ -35,15 +35,18 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, {
     
     speed : 0.2,
     startnumber : 0,
+    currentNumber : 0,
+    decimal : 0,
     
     digits : false, // array...
-    ulWidth : 0, 
+    ulWidth : 0,
+    cls : '',
     
     getAutoCreate : function(){
         
         return {
             tag: 'ul',
-            cls: 'flipcounter',
+            cls: 'flipcounter ' + this.cls,
             
         };
     },
@@ -56,6 +59,7 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, {
         {
             this.addDigit(startNum[i]);
         }
+        this.currentNumber = this.startnumber;
     },
     
     addDigit : function (num)
@@ -63,11 +67,14 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, {
         // Add separator after every 3rd digit
         if (this.digits.length % 3 == 0 && this.digits.length != 0)
         {
-            this.addSeparator();
+            this.addSeparator(',');
         }
         
-         
-        
+         if (this.digits.length % 3 == 0 && this.digits.length != 0)
+        {
+            this.addSeparator();
+        }
+          
         
         var digit = new Roo.ux.FlipCounter.Digit({ manager : this, currentNumber : num });
         digit.manager = this;
@@ -88,7 +95,7 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, {
         var digit = this.digits.splice(this.digits.length-1, 1)[0];
         
         this.ulWidth = this.ulWidth - digit.el.getWidth(true);
-        digit.li.remove();
+        digit.el.remove();
         
         // Remove separators
         if (this.digits.length % 3 == 0)
@@ -116,6 +123,7 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, {
     {
         var numStr = parseInt(num).toString();
         
+        this.currentNumber = num;
         // Change the number of digits displayed if needed
         if (numStr.length != this.digits.length)
         {