From f26ab8058730c0834692cc8257925fa6b647ad90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Ujj-M=C3=A9sz=C3=A1ros?= Date: Sat, 29 Mar 2014 16:13:20 +0100 Subject: [PATCH] Fixed updatesettings with empty inputs. --- bootstrap-touchspin.jquery.json | 2 +- bootstrap-touchspin/bootstrap.touchspin.js | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bootstrap-touchspin.jquery.json b/bootstrap-touchspin.jquery.json index 7a99065..241d623 100644 --- a/bootstrap-touchspin.jquery.json +++ b/bootstrap-touchspin.jquery.json @@ -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" diff --git a/bootstrap-touchspin/bootstrap.touchspin.js b/bootstrap-touchspin/bootstrap.touchspin.js index 9e92326..25683ed 100644 --- a/bootstrap-touchspin/bootstrap.touchspin.js +++ b/bootstrap-touchspin/bootstrap.touchspin.js @@ -3,7 +3,7 @@ /*!========================================================================= * Bootstrap TouchSpin - * v2.7.0 + * v2.7.1 * * A mobile and touch friendly input spinner component for Bootstrap 3. * @@ -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() {