From 80661a475823a7c102c4175158b656f452597ae8 Mon Sep 17 00:00:00 2001 From: Istvan Ujj-Meszaros Date: Thu, 25 May 2023 02:20:38 +0200 Subject: [PATCH] v4.7.1 --- LICENSE.md | 2 +- dist/jquery.bootstrap-touchspin.css | 2 +- dist/jquery.bootstrap-touchspin.js | 6 +++--- dist/jquery.bootstrap-touchspin.min.js | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index cfecb9c..90914f6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,7 +2,7 @@ MIT License Bootstrap TouchSpin -v4.7.0 +v4.7.1 A mobile and touch friendly input spinner component for Bootstrap 3 & 4. diff --git a/dist/jquery.bootstrap-touchspin.css b/dist/jquery.bootstrap-touchspin.css index 65706aa..d578adc 100644 --- a/dist/jquery.bootstrap-touchspin.css +++ b/dist/jquery.bootstrap-touchspin.css @@ -1,5 +1,5 @@ /* - * Bootstrap Touchspin - v4.7.0 + * Bootstrap Touchspin - v4.7.1 * A mobile and touch friendly input spinner component for Bootstrap 3 & 4. * https://www.virtuosoft.eu/code/bootstrap-touchspin/ * diff --git a/dist/jquery.bootstrap-touchspin.js b/dist/jquery.bootstrap-touchspin.js index 72d7b8b..3887b6f 100644 --- a/dist/jquery.bootstrap-touchspin.js +++ b/dist/jquery.bootstrap-touchspin.js @@ -1,5 +1,5 @@ /* - * Bootstrap Touchspin - v4.7.0 + * Bootstrap Touchspin - v4.7.1 * A mobile and touch friendly input spinner component for Bootstrap 3 & 4. * https://www.virtuosoft.eu/code/bootstrap-touchspin/ * @@ -765,7 +765,7 @@ value = value + boostedstep; } - if ((settings.max !== null) && (value > settings.max)) { + if ((settings.max !== null) && (value >= settings.max)) { value = settings.max; originalinput.trigger('touchspin.on.max'); stopSpin(); @@ -797,7 +797,7 @@ value = value - boostedstep; } - if ((settings.min !== null) && (value < settings.min)) { + if ((settings.min !== null) && (value <= settings.min)) { value = settings.min; originalinput.trigger('touchspin.on.min'); stopSpin(); diff --git a/dist/jquery.bootstrap-touchspin.min.js b/dist/jquery.bootstrap-touchspin.min.js index 7fa7702..4035fc4 100644 --- a/dist/jquery.bootstrap-touchspin.min.js +++ b/dist/jquery.bootstrap-touchspin.min.js @@ -1,12 +1,12 @@ /* - * Bootstrap Touchspin - v4.7.0 + * Bootstrap Touchspin - v4.7.1 * A mobile and touch friendly input spinner component for Bootstrap 3 & 4. * https://www.virtuosoft.eu/code/bootstrap-touchspin/ * * Made by István Ujj-Mészáros * Under MIT License */ -!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(t,o){return void 0===o&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(t)),n(o),o}:n(jQuery)}(function(S){"use strict";var T=0;S.fn.TouchSpin=function(N){var q={min:0,max:100,initval:"",replacementval:"",firstclickvalueifempty:null,step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalup:"+",verticaldown:"−",verticalupclass:"",verticaldownclass:"",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-primary",buttonup_class:"btn btn-primary",buttondown_txt:"−",buttonup_txt:"+",callback_before_calculation:function(t){return t},callback_after_calculation:function(t){return t}},B={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",firstclickvalueifempty:"first-click-value-if-empty",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each(function(){var s,a,e,p,t,n,o,i,u,r,c,l,d,f,b,h,v,m=S(this),x=m.data(),g=0,w=!1;function y(){""===s.prefix&&(a=p.prefix.detach()),""===s.postfix&&(e=p.postfix.detach())}function _(){var t,o,n=s.callback_before_calculation(m.val());""===n?""!==s.replacementval&&(m.val(s.replacementval),m.trigger("change")):0s.max&&(o=s.max),parseFloat(t).toString()!==parseFloat(o).toString()&&m.val(o),m.val(s.callback_after_calculation(parseFloat(o).toFixed(s.decimals))))}function k(){var t;return s.booster?(t=Math.pow(2,Math.floor(g/s.boostat))*s.step,s.maxboostedstep&&t>s.maxboostedstep&&(t=s.maxboostedstep,n=Math.round(n/t)*t),Math.max(s.step,t)):s.step}function C(){return"number"==typeof s.firstclickvalueifempty?s.firstclickvalueifempty:(s.min+s.max)/2}function $(){var t=m.is(":disabled,[readonly]");p.up.prop("disabled",t),p.down.prop("disabled",t),t&&P()}function F(){var t,o;m.is(":disabled,[readonly]")||(_(),t=n=parseFloat(s.callback_before_calculation(p.input.val())),isNaN(n)?n=C():(o=k(),n+=o),null!==s.max&&n>s.max&&(n=s.max,m.trigger("touchspin.on.max"),P()),p.input.val(s.callback_after_calculation(parseFloat(n).toFixed(s.decimals))),t!==n&&m.trigger("change"))}function j(){var t,o;m.is(":disabled,[readonly]")||(_(),t=n=parseFloat(s.callback_before_calculation(p.input.val())),isNaN(n)?n=C():(o=k(),n-=o),null!==s.min&&ns.max&&(o=s.max),parseFloat(t).toString()!==parseFloat(o).toString()&&m.val(o),m.val(s.callback_after_calculation(parseFloat(o).toFixed(s.decimals))))}function k(){var t;return s.booster?(t=Math.pow(2,Math.floor(g/s.boostat))*s.step,s.maxboostedstep&&t>s.maxboostedstep&&(t=s.maxboostedstep,n=Math.round(n/t)*t),Math.max(s.step,t)):s.step}function C(){return"number"==typeof s.firstclickvalueifempty?s.firstclickvalueifempty:(s.min+s.max)/2}function $(){var t=m.is(":disabled,[readonly]");p.up.prop("disabled",t),p.down.prop("disabled",t),t&&P()}function F(){var t,o;m.is(":disabled,[readonly]")||(_(),t=n=parseFloat(s.callback_before_calculation(p.input.val())),isNaN(n)?n=C():(o=k(),n+=o),null!==s.max&&n>=s.max&&(n=s.max,m.trigger("touchspin.on.max"),P()),p.input.val(s.callback_after_calculation(parseFloat(n).toFixed(s.decimals))),t!==n&&m.trigger("change"))}function j(){var t,o;m.is(":disabled,[readonly]")||(_(),t=n=parseFloat(s.callback_before_calculation(p.input.val())),isNaN(n)?n=C():(o=k(),n-=o),null!==s.min&&n<=s.min&&(n=s.min,m.trigger("touchspin.on.min"),P()),p.input.val(s.callback_after_calculation(parseFloat(n).toFixed(s.decimals))),t!==n&&m.trigger("change"))}function D(){m.is(":disabled,[readonly]")||(P(),g=0,w="down",m.trigger("touchspin.on.startspin"),m.trigger("touchspin.on.startdownspin"),u=setTimeout(function(){o=setInterval(function(){g++,j()},s.stepinterval)},s.stepintervaldelay))}function M(){m.is(":disabled,[readonly]")||(P(),g=0,w="up",m.trigger("touchspin.on.startspin"),m.trigger("touchspin.on.startupspin"),r=setTimeout(function(){i=setInterval(function(){g++,F()},s.stepinterval)},s.stepintervaldelay))}function P(){switch(clearTimeout(u),clearTimeout(r),clearInterval(o),clearInterval(i),w){case"up":m.trigger("touchspin.on.stopupspin"),m.trigger("touchspin.on.stopspin");break;case"down":m.trigger("touchspin.on.stopdownspin"),m.trigger("touchspin.on.stopspin")}g=0,w=!1}m.data("alreadyinitialized")||(m.data("alreadyinitialized",!0),T+=1,m.data("spinnerid",T),m.is("input")?(s=S.extend({},q,x,function(){var n={};return S.each(B,function(t,o){o="bts-"+o;m.is("[data-"+o+"]")&&(n[t]=m.data(o))}),S.each(["min","max","step"],function(t,o){m.is("["+o+"]")&&(void 0!==n[o]&&console.warn('Both the "data-bts-'+o+'" data attribute and the "'+o+'" individual attribute were specified, the individual attribute will take precedence on: ',m),n[o]=m.attr(o))}),n}(),N),1!==parseFloat(s.step)&&(0!=(c=s.max%s.step)&&(s.max=parseFloat(s.max)-c),0!=(c=s.min%s.step))&&(s.min=parseFloat(s.min)+(parseFloat(s.step)-c)),""!==s.initval&&""===m.val()&&m.val(s.initval),_(),c=m.val(),x=m.parent(),""!==c&&(c=s.callback_before_calculation(c),c=s.callback_after_calculation(parseFloat(c).toFixed(s.decimals))),m.data("initvalue",c).val(c),m.addClass("form-control"),t=` diff --git a/package.json b/package.json index 5e1d541..a929855 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-touchspin", - "version": "4.7.0", + "version": "4.7.1", "title": "Bootstrap Touchspin", "description": "A mobile and touch friendly input spinner component for Bootstrap 3 & 4.", "keywords": [