Skip to content

Commit

Permalink
noUiSlider 13.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed Feb 14, 2019
1 parent c63ba6d commit d4fd38b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 14 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ An extensive documentation, including **examples**, **options** and **configurat
Changelog
---------

### 13.1.1 (*2019-02-14*)
- Fixed: Slider hang when using a zero-length range (#948);

### 13.1.0 (*2019-02-08*)
- Fixed: Updating `pips` using `updateOptions` (#933);
- Added: Updating `tooltips` using `updateOptions` (#946);
Expand Down
2 changes: 1 addition & 1 deletion distribute/nouislider.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! nouislider - 13.1.0 - 2/8/2019 */
/*! nouislider - 13.1.1 - 2/14/2019 */
/* Functional styling;
* These styles are required for noUiSlider to function.
* You don't need to change these rules to apply your design.
Expand Down
36 changes: 27 additions & 9 deletions distribute/nouislider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! nouislider - 13.1.0 - 2/8/2019 */
/*! nouislider - 13.1.1 - 2/14/2019 */
(function(factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
Expand All @@ -13,7 +13,9 @@
})(function() {
"use strict";

var VERSION = "13.1.0";
var VERSION = "13.1.1";

//region Helper Methods

function isValidFormatter(entry) {
return typeof entry === "object" && typeof entry.to === "function" && typeof entry.from === "function";
Expand Down Expand Up @@ -194,7 +196,9 @@
return window.CSS && CSS.supports && CSS.supports("touch-action", "none");
}

// Value calculation
//endregion

//region Range Calculation

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

// Range conversion

function getJ(value, arr) {
var j = 1;

Expand Down Expand Up @@ -286,8 +288,6 @@
return xPct[j - 1] + closest(value - xPct[j - 1], xSteps[j - 1]);
}

// Entry parsing

function handleEntryPoint(index, value, that) {
var percentage;

Expand Down Expand Up @@ -336,7 +336,14 @@
function handleStepPoint(i, n, that) {
// Ignore 'false' stepping.
if (!n) {
return true;
return;
}

// Step over zero-length ranges (#948);
if (that.xVal[i] === that.xVal[i + 1]) {
that.xSteps[i] = that.xHighestCompleteStep[i] = that.xVal[i];

return;
}

// Factor to range ratio
Expand All @@ -350,7 +357,9 @@
that.xHighestCompleteStep[i] = step;
}

// Interface
//endregion

//region Spectrum

function Spectrum(entry, snap, singleStep) {
this.xPct = [];
Expand Down Expand Up @@ -466,6 +475,10 @@
return this.getStep(this.toStepping(value));
};

//endregion

//region Options

/* Every input option is tested and parsed. This'll prevent
endless validation in internal methods. These tests are
structured with an item for every option available. An
Expand Down Expand Up @@ -945,6 +958,8 @@
return parsed;
}

//endregion

function scope(target, options, originalOptions) {
var actions = getActions();
var supportsTouchActionNone = getSupportsTouchActionNone();
Expand Down Expand Up @@ -1808,6 +1823,9 @@
step = scope_Spectrum.getDefaultStep(scope_Locations[handleNumber], isDown, 10);
}

// Step over zero-length ranges (#948);
step = Math.max(step, 0.0000001);

// Decrement for down steps
step = (isDown ? -1 : 1) * step;

Expand Down
2 changes: 1 addition & 1 deletion distribute/nouislider.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions distribute/nouislider.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": "nouislider",
"version": "13.1.0",
"version": "13.1.1",
"main": "distribute/nouislider.js",
"style": "distribute/nouislider.min.css",
"license": "MIT",
Expand Down

0 comments on commit d4fd38b

Please sign in to comment.