Skip to content

Commit f75b661

Browse files
committed
Release
1 parent daf852d commit f75b661

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ npm [(package)](https://www.npmjs.com/package/nouislider)
2727
Changelog
2828
---------
2929

30-
### 11.0.1 (*2018-01-20*)
30+
### 11.0.2 (*2018-01-20*)
3131
- Fixed: Slider ignores clicks on `.noUi-target` outside of `.noUi-base` (#842);
3232
- Fixed: `.noUi-origin` moving out of the page causes horizontal scrolling (#852);
3333
- Fixed: Relative `.noUi-handle` has unintended margin (#854);

distribute/nouislider.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! nouislider - 11.0.1 - 2018-01-20 18:00:49 */
1+
/*! nouislider - 11.0.2 - 2018-01-20 18:05:29 */
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.
@@ -45,6 +45,12 @@
4545
-webkit-transform-origin: 0 0;
4646
transform-origin: 0 0;
4747
}
48+
/* Offset direction
49+
*/
50+
html:not([dir="rtl"]) .noUi-horizontal .noUi-origin {
51+
left: auto;
52+
right: 0;
53+
}
4854
/* Give origins 0 height/width so they don't interfere with clicking the
4955
* connect elements.
5056
*/
@@ -55,7 +61,7 @@
5561
height: 0;
5662
}
5763
.noUi-handle {
58-
position: relative;
64+
position: absolute;
5965
}
6066
.noUi-state-tap .noUi-connect,
6167
.noUi-state-tap .noUi-origin {
@@ -85,6 +91,10 @@
8591
left: -6px;
8692
top: -17px;
8793
}
94+
html:not([dir="rtl"]) .noUi-horizontal .noUi-handle {
95+
right: -17px;
96+
left: auto;
97+
}
8898
/* Styling;
8999
* Giving the connect element a border radius causes issues with using transform: scale
90100
*/

distribute/nouislider.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! nouislider - 11.0.1 - 2018-01-20 18:00:49 */
1+
/*! nouislider - 11.0.2 - 2018-01-20 18:05:29 */
22

33
(function (factory) {
44

@@ -22,7 +22,7 @@
2222

2323
'use strict';
2424

25-
var VERSION = '11.0.1';
25+
var VERSION = '11.0.2';
2626

2727

2828
function isValidFormatter ( entry ) {
@@ -951,6 +951,10 @@ function closure ( target, options, originalOptions ){
951951
var scope_DocumentElement = scope_Document.documentElement;
952952
var scope_Body = scope_Document.body;
953953

954+
// For horizontal sliders in standard ltr documents,
955+
// make .noUi-origin overflow to the left so the document doesn't scroll.
956+
var scope_DirOffset = (scope_Document.dir === 'rtl') || (options.ort === 1) ? 0 : 100;
957+
954958

955959
// Creates a node, adds it to target, returns the new node.
956960
function addNodeTo ( target, className ) {
@@ -1509,6 +1513,12 @@ function closure ( target, options, originalOptions ){
15091513
function calcPointToPercentage ( calcPoint ) {
15101514
var location = calcPoint - offset(scope_Base, options.ort);
15111515
var proposal = ( location * 100 ) / baseSize();
1516+
1517+
// Clamp proposal between 0% and 100%
1518+
// Out-of-bound coordinates may occur when .noUi-base pseudo-elements
1519+
// are used (e.g. contained handles feature)
1520+
proposal = limit(proposal);
1521+
15121522
return options.dir ? 100 - proposal : proposal;
15131523
}
15141524

@@ -1527,7 +1537,7 @@ function closure ( target, options, originalOptions ){
15271537

15281538
var pos = Math.abs(scope_Locations[index] - proposal);
15291539

1530-
if ( pos < closest ) {
1540+
if ( pos < closest || (pos === 100 && closest === 100) ) {
15311541
handleNumber = index;
15321542
closest = pos;
15331543
}
@@ -1965,7 +1975,7 @@ function closure ( target, options, originalOptions ){
19651975
// Convert the value to the slider stepping/range.
19661976
scope_Values[handleNumber] = scope_Spectrum.fromStepping(to);
19671977

1968-
var rule = 'translate(' + inRuleOrder(toPct(transformDirection(to, 0)), '0') + ')';
1978+
var rule = 'translate(' + inRuleOrder(toPct(transformDirection(to, 0) - scope_DirOffset), '0') + ')';
19691979
scope_Handles[handleNumber].style[options.transformRule] = rule;
19701980

19711981
updateConnect(handleNumber);

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": "11.0.1",
3+
"version": "11.0.2",
44
"main": "distribute/nouislider",
55
"style": "distribute/nouislider.min.css",
66
"license": "WTFPL",

0 commit comments

Comments
 (0)