Skip to content

Commit

Permalink
v4.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
istvan-ujjmeszaros committed Apr 7, 2023
1 parent 045d3a6 commit 24fe1d5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
MIT License

Bootstrap TouchSpin
v4.6.1
v4.6.2

A mobile and touch friendly input spinner component for Bootstrap 3 & 4.

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.bootstrap-touchspin.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Bootstrap Touchspin - v4.6.1
* Bootstrap Touchspin - v4.6.2
* A mobile and touch friendly input spinner component for Bootstrap 3 & 4.
* https://www.virtuosoft.eu/code/bootstrap-touchspin/
*
Expand Down
16 changes: 14 additions & 2 deletions dist/jquery.bootstrap-touchspin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Bootstrap Touchspin - v4.6.1
* Bootstrap Touchspin - v4.6.2
* A mobile and touch friendly input spinner component for Bootstrap 3 & 4.
* https://www.virtuosoft.eu/code/bootstrap-touchspin/
*
Expand Down Expand Up @@ -253,6 +253,8 @@
parentelement = originalinput.parent();

if (initval !== '') {
// initval may not be parsable as a number (callback_after_calculation() may decorate it so it cant be parsed). Use the callbacks if provided.
initval = settings.callback_before_calculation(initval);
initval = settings.callback_after_calculation(parseFloat(initval).toFixed(settings.decimals));
}

Expand Down Expand Up @@ -377,9 +379,17 @@
}
});

// change is fired before blur, so we need to work around that
$(document).on('mousedown touchstart', function(event) {
if ($(event.target).is(originalinput)) {
return;
}

_checkValue();
});

originalinput.on('blur.touchspin', function () {
_checkValue();
originalinput.val(settings.callback_after_calculation(originalinput.val()));
});

elements.down.on('keydown', function (ev) {
Expand Down Expand Up @@ -638,6 +648,8 @@
if (parseFloat(parsedval).toString() !== parseFloat(returnval).toString()) {
originalinput.val(returnval);
}

originalinput.val(settings.callback_after_calculation(parseFloat(returnval).toFixed(settings.decimals)));
}

function _getBoostedStep() {
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.bootstrap-touchspin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-touchspin",
"version": "4.6.1",
"version": "4.6.2",
"title": "Bootstrap Touchspin",
"description": "A mobile and touch friendly input spinner component for Bootstrap 3 & 4.",
"keywords": [
Expand Down

0 comments on commit 24fe1d5

Please sign in to comment.