can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r11567: LJSUP-11414: 99 999 999 tokens

Committer: dpetrov
LJSUP-11414: 99 999 999 tokens
U   trunk/htdocs/js/jquery/jquery.lj.range.js
U   trunk/templates/Shop/Wallet.tmpl
Modified: trunk/htdocs/js/jquery/jquery.lj.range.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.range.js	2012-03-12 11:33:12 UTC (rev 11566)
+++ trunk/htdocs/js/jquery/jquery.lj.range.js	2012-03-12 11:43:30 UTC (rev 11567)
@@ -26,7 +26,7 @@
 
 			valueInput: null,
 			min: 500,
-			max: 99999900,
+			max: 65000,
 			step: 100,
 			defValue: 500,
 			delims: [500, 1000, 2000, 3000, 4000, 5000, 15000, 30000]
@@ -124,7 +124,12 @@
 		},
 
 		_onInput: function(ev) {
-			var value = this._correctValue(this._input.val());
+			var inputValue = this._input.val(),
+				value = this._correctValue(this._input.val());
+
+			if (value < parseInt(inputValue, 10)) {
+				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
@@ -152,8 +157,10 @@
 		},
 
 		_correctValue: function(value) {
-			var value, reminder;
+			var reminder;
 
+			value = parseInt(value, 10) || 0;
+
 			reminder = value % this.options.step;
 			value -= reminder;
 
@@ -207,7 +214,7 @@
 			} else if (val > delims[delims.length - 1]) {
 				position = this._exceedOffset;
 			} else if (val === delims[delims.length - 1]) {
-				position = delims[delims.length - 1];
+				position = this._offsets[delims.length - 1];
 			} else {
 				while (val > delims[idx]) { idx++; }
 				shift = (val - delims[idx-1]) / (delims[idx] - delims[idx-1]);

Modified: trunk/templates/Shop/Wallet.tmpl
===================================================================
--- trunk/templates/Shop/Wallet.tmpl	2012-03-12 11:33:12 UTC (rev 11566)
+++ trunk/templates/Shop/Wallet.tmpl	2012-03-12 11:43:30 UTC (rev 11567)
@@ -56,7 +56,7 @@
 					<div class="b-wallet2">
 						<TMPL_INCLUDE templates/Widgets/range.tmpl>
 						<label for="buy_select" class="b-wallet2-tokens">
-							<input type="text" name="buy_select" id="buy_select" value="100" maxlength="8" tabindex="55" class="b-wallet2-amount">
+							<input type="text" name="buy_select" id="buy_select" value="100" maxlength="5" tabindex="55" class="b-wallet2-amount">
 							<span><TMPL_VAR expr="ml('shop.view.wallet.buy.tokens')"></span>
 						</label>
 					</div>

Tags: can3p, dpetrov, js, ljcom, tmpl
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 

  • 1 comment