diff --git a/dist/nouislider.js b/dist/nouislider.js index 151bb6bd..01fc0bc1 100644 --- a/dist/nouislider.js +++ b/dist/nouislider.js @@ -714,6 +714,7 @@ var hover = entry.indexOf("hover") >= 0; var unconstrained = entry.indexOf("unconstrained") >= 0; var dragAll = entry.indexOf("drag-all") >= 0; + var smoothSteps = entry.indexOf("smooth-steps") >= 0; if (fixed) { if (parsed.handles !== 2) { throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles"); @@ -728,6 +729,7 @@ tap: tap || snap, drag: drag, dragAll: dragAll, + smoothSteps: smoothSteps, fixed: fixed, snap: snap, hover: hover, @@ -1472,6 +1474,14 @@ scope_Body.removeEventListener("selectstart", preventDefault); } } + if (options.events.smoothSteps) { + data.handleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false); + }); + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + }); + } data.handleNumbers.forEach(function (handleNumber) { fireEvent("change", handleNumber); fireEvent("set", handleNumber); @@ -1771,7 +1781,7 @@ }); } // Split out the handle positioning logic so the Move event can use it, too - function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue) { + function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) { var distance; // For sliders with multiple handles, limit movement to the other handle. // Apply the margin option by adding it to the handle positions. @@ -1810,7 +1820,9 @@ to = Math.min(to, distance); } } - to = scope_Spectrum.getStep(to); + if (!smoothSteps) { + to = scope_Spectrum.getStep(to); + } // Limit percentage to the 0 - 100 range to = limit(to); // Return false if handle can't move @@ -1830,6 +1842,7 @@ var proposals = locations.slice(); // Store first handle now, so we still have it in case handleNumbers is reversed var firstHandle = handleNumbers[0]; + var smoothSteps = options.events.smoothSteps; var b = [!upward, upward]; var f = [upward, !upward]; // Copy handleNumbers so we don't change the dataset @@ -1842,7 +1855,7 @@ // Step 1: get the maximum percentage that any of the handles can move if (handleNumbers.length > 1) { handleNumbers.forEach(function (handleNumber, o) { - var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false); + var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps); // Stop if one of the handles can't move. if (to === false) { proposal = 0; @@ -1860,7 +1873,8 @@ var state = false; // Step 2: Try to set the handles with the found percentage handleNumbers.forEach(function (handleNumber, o) { - state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state; + state = + setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state; }); // Step 3: If a handle moved, fire events if (state) { @@ -1905,9 +1919,9 @@ } // Test suggested values and apply margin, step. // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436) - function setHandle(handleNumber, to, lookBackward, lookForward, exactInput) { + function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) { if (!exactInput) { - to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false); + to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps); } if (to === false) { return false; diff --git a/dist/nouislider.min.js b/dist/nouislider.min.js index 18ac4798..ca2b37b7 100644 --- a/dist/nouislider.min.js +++ b/dist/nouislider.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).noUiSlider={})}(this,function(ot){"use strict";function n(t){return"object"==typeof t&&"function"==typeof t.to}function st(t){t.parentElement.removeChild(t)}function at(t){return null!=t}function lt(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function ut(t,e,r){0=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=l(r,t),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return t+(r=r,a(o=[i,o],o[0]<0?r+Math.abs(o[0]):r-o[0],0)/s(t,n))}function o(t,e,r,n){if(100===n)return n;var i=l(n,t),o=t[i-1],s=t[i];return r?(s-o)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,o=1,s=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),U(n,t.stepped)}(d),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=h.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,o,s,a,l,u,t=t,c=h[e+1],p=d.mode===ot.PipsMode.Steps,f=(f=p?S.xNumSteps[e]:f)||c-t;for(void 0===c&&(c=t),f=Math.max(f,1e-7),r=t;r<=c;r=Number((r+f).toFixed(7))){for(a=(o=(i=S.toStepping(r))-b)/(d.density||1),u=o/(l=Math.round(a)),n=1;n<=l;n+=1)m[(s=b+n*u).toFixed(5)]=[S.fromStepping(s),0];a=-1ot.PipsType.NoValue&&((t=P(a,!1)).className=p(n,f.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[f.style]=e+"%",t.innerHTML=String(s.to(r))))}),a}function L(){n&&(st(n),n=null)}function T(t){L();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return n=d.appendChild(O(e,r,t))}function j(){var t=i.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||i[e]:t.height||i[e]}function z(n,i,o,s){function e(t){var e,r=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),s=0,a=0;0===e.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}ft(t=d,f.cssClasses.target),0===f.dir?ft(t,f.cssClasses.ltr):ft(t,f.cssClasses.rtl),0===f.ort?ft(t,f.cssClasses.horizontal):ft(t,f.cssClasses.vertical),ft(t,"rtl"===getComputedStyle(t).direction?f.cssClasses.textDirectionRtl:f.cssClasses.textDirectionLtr),i=P(t,f.cssClasses.base),function(t,e){var r=P(e,f.cssClasses.connects);a=[],(l=[]).push(N(r,t[0]));for(var n=0;n=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=l(r,t),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return t+(r=r,a(o=[i,o],o[0]<0?r+Math.abs(o[0]):r-o[0],0)/s(t,n))}function o(t,e,r,n){if(100===n)return n;var i=l(n,t),o=t[i-1],s=t[i];return r?(s-o)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,o=1,s=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),U(n,t.stepped)}(d),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=h.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,o,s,a,l,u,t=t,c=h[e+1],p=d.mode===ot.PipsMode.Steps,f=(f=p?S.xNumSteps[e]:f)||c-t;for(void 0===c&&(c=t),f=Math.max(f,1e-7),r=t;r<=c;r=Number((r+f).toFixed(7))){for(a=(o=(i=S.toStepping(r))-b)/(d.density||1),u=o/(l=Math.round(a)),n=1;n<=l;n+=1)m[(s=b+n*u).toFixed(5)]=[S.fromStepping(s),0];a=-1ot.PipsType.NoValue&&((t=P(a,!1)).className=p(n,f.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[f.style]=e+"%",t.innerHTML=String(s.to(r))))}),a}function L(){n&&(st(n),n=null)}function T(t){L();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return n=d.appendChild(O(e,r,t))}function j(){var t=i.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||i[e]:t.height||i[e]}function z(n,i,o,s){function e(t){var e,r=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),s=0,a=0;0===e.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}ft(t=d,f.cssClasses.target),0===f.dir?ft(t,f.cssClasses.ltr):ft(t,f.cssClasses.rtl),0===f.ort?ft(t,f.cssClasses.horizontal):ft(t,f.cssClasses.vertical),ft(t,"rtl"===getComputedStyle(t).direction?f.cssClasses.textDirectionRtl:f.cssClasses.textDirectionLtr),i=P(t,f.cssClasses.base),function(t,e){var r=P(e,f.cssClasses.connects);l=[],(a=[]).push(N(r,t[0]));for(var n=0;n=e[r];)r+=1;return r}function toStepping(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=getJ(r,t),i=t[n-1],s=t[n],t=e[n-1],n=e[n];return t+toPercentage([i,s],r)/subRangeRatio(t,n)}function fromStepping(t,e,r){if(100<=r)return t.slice(-1)[0];var n=getJ(r,e),i=t[n-1],s=t[n],t=e[n-1];return isPercentage([i,s],(r-t)*subRangeRatio(t,e[n]))}function getStep(t,e,r,n){if(100===n)return n;var i=getJ(n,t),s=t[i-1],o=t[i];return r?(o-s)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,s=1,o=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),M(n,t.stepped)}(f),m={},t=b.xVal[0],e=b.xVal[b.xVal.length-1],g=!1,v=!1,S=0;return(h=unique(h.slice().sort(function(t,e){return t-e})))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,s,o,a,l,u,t=t,c=h[e+1],p=f.mode===PipsMode.Steps,d=(d=p?b.xNumSteps[e]:d)||c-t;for(void 0===c&&(c=t),d=Math.max(d,1e-7),r=t;r<=c;r=Number((r+d).toFixed(7))){for(a=(s=(i=b.toStepping(r))-S)/(f.density||1),u=s/(l=Math.round(a)),n=1;n<=l;n+=1)m[(o=S+n*u).toFixed(5)]=[b.fromStepping(o),0];a=-1PipsType.NoValue&&((t=N(a,!1)).className=p(n,d.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[d.style]=e+"%",t.innerHTML=String(o.to(r))))}),a}function U(){n&&(removeElement(n),n=null)}function L(t){U();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return n=f.appendChild(T(e,r,t))}function O(){var t=r.getBoundingClientRect(),e="offset"+["Width","Height"][d.ort];return 0===d.ort?t.width||r[e]:t.height||r[e]}function F(e,r,n,i){function s(t){return!!(t=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),s=0===e.type.indexOf("pointer"),o=0,a=0;0===e.type.indexOf("MSPointer")&&(s=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=b.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}addClass(t=f,d.cssClasses.target),0===d.dir?addClass(t,d.cssClasses.ltr):addClass(t,d.cssClasses.rtl),0===d.ort?addClass(t,d.cssClasses.horizontal):addClass(t,d.cssClasses.vertical),addClass(t,"rtl"===getComputedStyle(t).direction?d.cssClasses.textDirectionRtl:d.cssClasses.textDirectionLtr),r=N(t,d.cssClasses.base),function(t,e){var r=N(e,d.cssClasses.connects);a=[],(l=[]).push(w(r,t[0]));for(var n=0;n=e[r];)r+=1;return r}function toStepping(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=getJ(r,t),i=t[n-1],s=t[n],t=e[n-1],n=e[n];return t+toPercentage([i,s],r)/subRangeRatio(t,n)}function fromStepping(t,e,r){if(100<=r)return t.slice(-1)[0];var n=getJ(r,e),i=t[n-1],s=t[n],t=e[n-1];return isPercentage([i,s],(r-t)*subRangeRatio(t,e[n]))}function getStep(t,e,r,n){if(100===n)return n;var i=getJ(n,t),s=t[i-1],o=t[i];return r?(o-s)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,s=1,o=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),M(n,t.stepped)}(f),m={},t=b.xVal[0],e=b.xVal[b.xVal.length-1],g=!1,v=!1,S=0;return(h=unique(h.slice().sort(function(t,e){return t-e})))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,s,o,a,l,u,t=t,c=h[e+1],p=f.mode===PipsMode.Steps,d=(d=p?b.xNumSteps[e]:d)||c-t;for(void 0===c&&(c=t),d=Math.max(d,1e-7),r=t;r<=c;r=Number((r+d).toFixed(7))){for(a=(s=(i=b.toStepping(r))-S)/(f.density||1),u=s/(l=Math.round(a)),n=1;n<=l;n+=1)m[(o=S+n*u).toFixed(5)]=[b.fromStepping(o),0];a=-1PipsType.NoValue&&((t=N(a,!1)).className=p(n,d.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[d.style]=e+"%",t.innerHTML=String(o.to(r))))}),a}function U(){n&&(removeElement(n),n=null)}function L(t){U();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return n=f.appendChild(T(e,r,t))}function O(){var t=r.getBoundingClientRect(),e="offset"+["Width","Height"][d.ort];return 0===d.ort?t.width||r[e]:t.height||r[e]}function F(e,r,n,i){function s(t){return!!(t=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),s=0===e.type.indexOf("pointer"),o=0,a=0;0===e.type.indexOf("MSPointer")&&(s=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=b.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}addClass(t=f,d.cssClasses.target),0===d.dir?addClass(t,d.cssClasses.ltr):addClass(t,d.cssClasses.rtl),0===d.ort?addClass(t,d.cssClasses.horizontal):addClass(t,d.cssClasses.vertical),addClass(t,"rtl"===getComputedStyle(t).direction?d.cssClasses.textDirectionRtl:d.cssClasses.textDirectionLtr),r=N(t,d.cssClasses.base),function(t,e){var r=N(e,d.cssClasses.connects);l=[],(a=[]).push(w(r,t[0]));for(var n=0;n= 0; var unconstrained = entry.indexOf("unconstrained") >= 0; var dragAll = entry.indexOf("drag-all") >= 0; + var smoothSteps = entry.indexOf("smooth-steps") >= 0; if (fixed) { if (parsed.handles !== 2) { throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles"); @@ -723,6 +724,7 @@ function testBehaviour(parsed, entry) { tap: tap || snap, drag: drag, dragAll: dragAll, + smoothSteps: smoothSteps, fixed: fixed, snap: snap, hover: hover, @@ -1467,6 +1469,14 @@ function scope(target, options, originalOptions) { scope_Body.removeEventListener("selectstart", preventDefault); } } + if (options.events.smoothSteps) { + data.handleNumbers.forEach(function (handleNumber) { + setHandle(handleNumber, scope_Locations[handleNumber], true, true, false, false); + }); + data.handleNumbers.forEach(function (handleNumber) { + fireEvent("update", handleNumber); + }); + } data.handleNumbers.forEach(function (handleNumber) { fireEvent("change", handleNumber); fireEvent("set", handleNumber); @@ -1766,7 +1776,7 @@ function scope(target, options, originalOptions) { }); } // Split out the handle positioning logic so the Move event can use it, too - function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue) { + function checkHandlePosition(reference, handleNumber, to, lookBackward, lookForward, getValue, smoothSteps) { var distance; // For sliders with multiple handles, limit movement to the other handle. // Apply the margin option by adding it to the handle positions. @@ -1805,7 +1815,9 @@ function scope(target, options, originalOptions) { to = Math.min(to, distance); } } - to = scope_Spectrum.getStep(to); + if (!smoothSteps) { + to = scope_Spectrum.getStep(to); + } // Limit percentage to the 0 - 100 range to = limit(to); // Return false if handle can't move @@ -1825,6 +1837,7 @@ function scope(target, options, originalOptions) { var proposals = locations.slice(); // Store first handle now, so we still have it in case handleNumbers is reversed var firstHandle = handleNumbers[0]; + var smoothSteps = options.events.smoothSteps; var b = [!upward, upward]; var f = [upward, !upward]; // Copy handleNumbers so we don't change the dataset @@ -1837,7 +1850,7 @@ function scope(target, options, originalOptions) { // Step 1: get the maximum percentage that any of the handles can move if (handleNumbers.length > 1) { handleNumbers.forEach(function (handleNumber, o) { - var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false); + var to = checkHandlePosition(proposals, handleNumber, proposals[handleNumber] + proposal, b[o], f[o], false, smoothSteps); // Stop if one of the handles can't move. if (to === false) { proposal = 0; @@ -1855,7 +1868,8 @@ function scope(target, options, originalOptions) { var state = false; // Step 2: Try to set the handles with the found percentage handleNumbers.forEach(function (handleNumber, o) { - state = setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o]) || state; + state = + setHandle(handleNumber, locations[handleNumber] + proposal, b[o], f[o], false, smoothSteps) || state; }); // Step 3: If a handle moved, fire events if (state) { @@ -1900,9 +1914,9 @@ function scope(target, options, originalOptions) { } // Test suggested values and apply margin, step. // if exactInput is true, don't run checkHandlePosition, then the handle can be placed in between steps (#436) - function setHandle(handleNumber, to, lookBackward, lookForward, exactInput) { + function setHandle(handleNumber, to, lookBackward, lookForward, exactInput, smoothSteps) { if (!exactInput) { - to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false); + to = checkHandlePosition(scope_Locations, handleNumber, to, lookBackward, lookForward, false, smoothSteps); } if (to === false) { return false;