Skip to content

Commit d4fd38b

Browse files
committed
noUiSlider 13.1.1
1 parent c63ba6d commit d4fd38b

File tree

6 files changed

+35
-14
lines changed

6 files changed

+35
-14
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ An extensive documentation, including **examples**, **options** and **configurat
2020
Changelog
2121
---------
2222

23+
### 13.1.1 (*2019-02-14*)
24+
- Fixed: Slider hang when using a zero-length range (#948);
25+
2326
### 13.1.0 (*2019-02-08*)
2427
- Fixed: Updating `pips` using `updateOptions` (#933);
2528
- Added: Updating `tooltips` using `updateOptions` (#946);

distribute/nouislider.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! nouislider - 13.1.0 - 2/8/2019 */
1+
/*! nouislider - 13.1.1 - 2/14/2019 */
22
/* Functional styling;
33
* These styles are required for noUiSlider to function.
44
* You don't need to change these rules to apply your design.

distribute/nouislider.js

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! nouislider - 13.1.0 - 2/8/2019 */
1+
/*! nouislider - 13.1.1 - 2/14/2019 */
22
(function(factory) {
33
if (typeof define === "function" && define.amd) {
44
// AMD. Register as an anonymous module.
@@ -13,7 +13,9 @@
1313
})(function() {
1414
"use strict";
1515

16-
var VERSION = "13.1.0";
16+
var VERSION = "13.1.1";
17+
18+
//region Helper Methods
1719

1820
function isValidFormatter(entry) {
1921
return typeof entry === "object" && typeof entry.to === "function" && typeof entry.from === "function";
@@ -194,7 +196,9 @@
194196
return window.CSS && CSS.supports && CSS.supports("touch-action", "none");
195197
}
196198

197-
// Value calculation
199+
//endregion
200+
201+
//region Range Calculation
198202

199203
// Determine the size of a sub-range in relation to a full range.
200204
function subRangeRatio(pa, pb) {
@@ -216,8 +220,6 @@
216220
return (value * (range[1] - range[0])) / 100 + range[0];
217221
}
218222

219-
// Range conversion
220-
221223
function getJ(value, arr) {
222224
var j = 1;
223225

@@ -286,8 +288,6 @@
286288
return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]);
287289
}
288290

289-
// Entry parsing
290-
291291
function handleEntryPoint(index, value, that) {
292292
var percentage;
293293

@@ -336,7 +336,14 @@
336336
function handleStepPoint(i, n, that) {
337337
// Ignore 'false' stepping.
338338
if (!n) {
339-
return true;
339+
return;
340+
}
341+
342+
// Step over zero-length ranges (#948);
343+
if (that.xVal[i] === that.xVal[i + 1]) {
344+
that.xSteps[i] = that.xHighestCompleteStep[i] = that.xVal[i];
345+
346+
return;
340347
}
341348

342349
// Factor to range ratio
@@ -350,7 +357,9 @@
350357
that.xHighestCompleteStep[i] = step;
351358
}
352359

353-
// Interface
360+
//endregion
361+
362+
//region Spectrum
354363

355364
function Spectrum(entry, snap, singleStep) {
356365
this.xPct = [];
@@ -466,6 +475,10 @@
466475
return this.getStep(this.toStepping(value));
467476
};
468477

478+
//endregion
479+
480+
//region Options
481+
469482
/* Every input option is tested and parsed. This'll prevent
470483
endless validation in internal methods. These tests are
471484
structured with an item for every option available. An
@@ -945,6 +958,8 @@
945958
return parsed;
946959
}
947960

961+
//endregion
962+
948963
function scope(target, options, originalOptions) {
949964
var actions = getActions();
950965
var supportsTouchActionNone = getSupportsTouchActionNone();
@@ -1808,6 +1823,9 @@
18081823
step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, 10);
18091824
}
18101825

1826+
// Step over zero-length ranges (#948);
1827+
step = Math.max(step, 0.0000001);
1828+
18111829
// Decrement for down steps
18121830
step = (isDown ? -1 : 1) * step;
18131831

distribute/nouislider.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

distribute/nouislider.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nouislider",
3-
"version": "13.1.0",
3+
"version": "13.1.1",
44
"main": "distribute/nouislider.js",
55
"style": "distribute/nouislider.min.css",
66
"license": "MIT",

0 commit comments

Comments
 (0)