Skip to content

Commit

Permalink
noUiSlider 14.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed Mar 27, 2020
1 parent f46a310 commit f8090f1
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 14.2.0 (*2020-03-27*)
- Added: Slider api as event parameter (#1058);
- Added: Allow multiple classes in `cssClasses` option (#1054);
- Fixed: Slider not working within shadow DOM (#1060);
- Fixed: Last pip not rendered if it is also the first and at the slider edge (#1063);

### 14.1.1 (*2019-12-15*)
- Fixed: Text direction is not correctly determined when the slider is not in the DOM (#1038);

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 - 14.1.1 - 12/15/2019 */
/*! nouislider - 14.2.0 - 3/27/2020 */
/* Functional styling;
* These styles are required for noUiSlider to function.
* You don't need to change these rules to apply your design.
Expand Down
18 changes: 12 additions & 6 deletions distribute/nouislider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! nouislider - 14.1.1 - 12/15/2019 */
/*! nouislider - 14.2.0 - 3/27/2020 */
(function(factory) {
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
Expand All @@ -13,7 +13,7 @@
})(function() {
"use strict";

var VERSION = "14.1.1";
var VERSION = "14.2.0";

//region Helper Methods

Expand Down Expand Up @@ -100,7 +100,7 @@

// http://youmightnotneedjquery.com/#add_class
function addClass(el, className) {
if (el.classList) {
if (el.classList && !/\s/.test(className)) {
el.classList.add(className);
} else {
el.className += " " + className;
Expand Down Expand Up @@ -1329,7 +1329,7 @@
type = group.indexOf(i) > -1 ? PIPS_LARGE_VALUE : isSteps ? PIPS_SMALL_VALUE : PIPS_NO_VALUE;

// Enforce the 'ignoreFirst' option by overwriting the type for 0.
if (!index && ignoreFirst) {
if (!index && ignoreFirst && i !== high) {
type = 0;
}

Expand Down Expand Up @@ -1520,7 +1520,11 @@
if (touch) {
// Returns true if a touch originated on the target.
var isTouchOnTarget = function(checkTouch) {
return checkTouch.target === eventTarget || eventTarget.contains(checkTouch.target);
return (
checkTouch.target === eventTarget ||
eventTarget.contains(checkTouch.target) ||
(checkTouch.target.shadowRoot && checkTouch.target.shadowRoot.contains(eventTarget))
);
};

// In the case of touchstart events, we need to make sure there is still no more than one
Expand Down Expand Up @@ -1987,7 +1991,9 @@
// Event is fired by tap, true or false
tap || false,
// Left offset of the handle, in relation to the slider
scope_Locations.slice()
scope_Locations.slice(),
// add the slider public API to an accessible parameter when this is unavailable
scope_Self
);
});
}
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 documentation/events-callbacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

<p><code>unencoded</code> contains the slider values without any formatting. </p>

<p>For all events, <code>this</code> is set to the current slider's API, containing (among others) the <code>.get()</code> and <code>.set()</code> methods.</p>
<p>For all events, <code>this</code> is set to the current slider's API, containing (among others) the <code>.get()</code> and <code>.set()</code> methods. The slider api is also available as the sixth argument to all events.</p>
</div>

<?php code('binding'); ?>
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

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": "14.1.1",
"version": "14.2.0",
"main": "distribute/nouislider.js",
"style": "distribute/nouislider.min.css",
"license": "MIT",
Expand Down
6 changes: 5 additions & 1 deletion src/nouislider.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,11 @@
if (touch) {
// Returns true if a touch originated on the target.
var isTouchOnTarget = function(checkTouch) {
return checkTouch.target === eventTarget || eventTarget.contains(checkTouch.target) || (checkTouch.target.shadowRoot && checkTouch.target.shadowRoot.contains(eventTarget));
return (
checkTouch.target === eventTarget ||
eventTarget.contains(checkTouch.target) ||
(checkTouch.target.shadowRoot && checkTouch.target.shadowRoot.contains(eventTarget))
);
};

// In the case of touchstart events, we need to make sure there is still no more than one
Expand Down

0 comments on commit f8090f1

Please sign in to comment.