From 56d65270121c17f7e4000a8e51d1515970466f0a Mon Sep 17 00:00:00 2001 From: Dejan Novovic Date: Thu, 14 Apr 2016 15:53:56 +0200 Subject: [PATCH 1/2] Update tick.js added dynamical incremental change and maxValue --- assets/js/tick.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/assets/js/tick.js b/assets/js/tick.js index 78a9564..4240a1e 100755 --- a/assets/js/tick.js +++ b/assets/js/tick.js @@ -1,4 +1,4 @@ -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.6.3 forked from harvesthq, novovic edit. (function() { var $, Tick, Tick_Flip, Tick_Scroll, _ref, _ref1, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, @@ -49,6 +49,7 @@ separators boolean if true, all arbitrary characters inbetween digits are wrapped in seperated elements if false, these characters are stripped out autostart boolean whether or not to start the ticker when instantiated + maxValue int maximum value after the ticker would stop ticking Events @@ -84,7 +85,7 @@ return option; } else if (typeof option === 'number') { return function(val) { - return val + option; + return val + this.options.incremental; }; } else { return function(val) { @@ -156,8 +157,14 @@ Tick.prototype.tick = function() { this.value = this.increment(this.value); - this.render(); - return this.set_timer(); + if (this.value >= this.options.maxValue) { + this.value = this.options.maxValue; + this.render(); + return this.stop(); + } else { + this.render(); + return this.set_timer(); + } }; /* From 2a0a3b15b675fb0255ae4c267be444eb3ec6aa58 Mon Sep 17 00:00:00 2001 From: Dejan Novovic Date: Thu, 14 Apr 2016 15:55:28 +0200 Subject: [PATCH 2/2] Update README.md updated usage for option maxValue --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 29ff22e..8a7f223 100644 --- a/README.md +++ b/README.md @@ -51,5 +51,8 @@ Options * `separators` _boolean_ if true, all arbitrary characters inbetween digits are wrapped in seperated elements. if false, these characters are stripped out +* `maxValue` _int_ + maximum value after the ticker would stop ticking + * `autostart` _boolean_ whether or not to start the ticker when instantiated