Skip to content

Commit

Permalink
Fixed updatesettings with empty inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
istvan-ujjmeszaros committed Mar 29, 2014
1 parent 91750db commit f26ab80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bootstrap-touchspin.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"spinbutton",
"spinner"
],
"version": "2.7.0",
"version": "2.7.1",
"author": {
"name": "István Ujj-Mészáros",
"url": "https://github.com/istvan-ujjmeszaros"
Expand Down
10 changes: 7 additions & 3 deletions bootstrap-touchspin/bootstrap.touchspin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/*!=========================================================================
* Bootstrap TouchSpin
* v2.7.0
* v2.7.1
*
* A mobile and touch friendly input spinner component for Bootstrap 3.
*
Expand Down Expand Up @@ -138,8 +138,12 @@
_updateSettings(newsettings);
_checkValue();

var value = Number(elements.input.val());
elements.input.val(value.toFixed(settings.decimals));
var value = elements.input.val();

if (value !== "") {
value = Number(elements.input.val());
elements.input.val(value.toFixed(settings.decimals));
}
}

function _initSettings() {
Expand Down

0 comments on commit f26ab80

Please sign in to comment.