X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=ux%2FFlipCounter.js;h=0296373a26c84aaba21120b827652781ff211035;hb=0b69a11b1055a6d3a3fd0719bdd58b5a235de0e4;hp=2eebb7ae3a8e050e8abdee0d21b68efacd3f5e2e;hpb=88c4805a760111dd61bc7a2189d85151e889ef97;p=roojs1 diff --git a/ux/FlipCounter.js b/ux/FlipCounter.js index 2eebb7ae3a..0296373a26 100644 --- a/ux/FlipCounter.js +++ b/ux/FlipCounter.js @@ -53,7 +53,10 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, { initEvents : function () { + + var startNum = (1.0*this.startnumber).toFixed(this.decimal); + //Roo.log("STARTNUmber: " + startNum); for (i=startNum.length-1; i>=0; i=i-1) { @@ -68,12 +71,13 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, { addDigit : function (num) { + + //Roo.log("Add digit "+ num); // Add separator after every 3rd digit - /*if (this.digits.length % 3 == 0 && this.digits.length != 0) - { + if (this.decimal == 0 && this.digits.length % 3 == 0 && this.digits.length != 0) { this.addSeparator(','); } - */ + var digit = new Roo.ux.FlipCounter.Digit({ manager : this, currentNumber : num }); @@ -98,12 +102,12 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, { digit.el.remove(); // Remove separators - // if (this.digits.length % 3 == 0) - // { - // var comma = this.el.select('li.comma:first-child'); - // this.ulWidth = this.ulWidth - comma.getWidth(true); - // comma.remove(); - //} + if (this.decimal == 0 & this.digits.length % 3 == 0) + { + var comma = this.el.select('li.comma:first-child'); + this.ulWidth = this.ulWidth - comma.getWidth(true); + comma.remove(); + } // Update width to current this.el.set( { 'min-width' : this.ulWidth}); @@ -130,7 +134,7 @@ Roo.extend(Roo.ux.FlipCounter, Roo.bootstrap.Component, { if (numStr.length != dl) { var diff = numStr.length - dl; - Roo.log("DIFF LEN=" +diff); + //Roo.log("DIFF LEN=" +diff); if (diff > 0) { for (i=0; i