Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[ljcom] r12006: LJSUP-12257: LJ Tokens should be rounded...

Committer: anazarov
LJSUP-12257: LJ Tokens should be rounded up in LJ Shop
U   trunk/htdocs/js/jquery/jquery.lj.range.js
Modified: trunk/htdocs/js/jquery/jquery.lj.range.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.range.js	2012-05-24 13:37:38 UTC (rev 12005)
+++ trunk/htdocs/js/jquery/jquery.lj.range.js	2012-05-24 13:42:44 UTC (rev 12006)
@@ -127,10 +127,10 @@
 			var inputValue = this._input.val(),
 				value = this._correctValue(this._input.val());
 
-			if (value < parseInt(inputValue, 10)) {
-				value += this.options.step;
+			if (value > parseInt(inputValue, 10) && value > this.options.min) {
 				this._input.val(value);
 			}
+
 			this._updateHandle(value);
 			//we do not update the value here, because users still types
 			//and we can still update the value on blur and submit events
@@ -165,8 +165,8 @@
 			reminder = value % this.options.step;
 			value -= reminder;
 
-			if (reminder / this.options.step > 0.5) {
-				value += this.options.step;
+			if (reminder) {
+				value += +this.options.step;
 			}
 
 			if (value < this.options.min) { value = this.options.min; }

Tags: anazarov, js, ljcom, nfokz
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments