Skip to content

Commit

Permalink
Release
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed Jan 20, 2018
1 parent daf852d commit f75b661
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ npm [(package)](https://www.npmjs.com/package/nouislider)
Changelog
---------

### 11.0.1 (*2018-01-20*)
### 11.0.2 (*2018-01-20*)
- Fixed: Slider ignores clicks on `.noUi-target` outside of `.noUi-base` (#842);
- Fixed: `.noUi-origin` moving out of the page causes horizontal scrolling (#852);
- Fixed: Relative `.noUi-handle` has unintended margin (#854);
Expand Down
14 changes: 12 additions & 2 deletions distribute/nouislider.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! nouislider - 11.0.1 - 2018-01-20 18:00:49 */
/*! nouislider - 11.0.2 - 2018-01-20 18:05:29 */
/* Functional styling;
* These styles are required for noUiSlider to function.
* You don't need to change these rules to apply your design.
Expand Down Expand Up @@ -45,6 +45,12 @@
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
/* Offset direction
*/
html:not([dir="rtl"]) .noUi-horizontal .noUi-origin {
left: auto;
right: 0;
}
/* Give origins 0 height/width so they don't interfere with clicking the
* connect elements.
*/
Expand All @@ -55,7 +61,7 @@
height: 0;
}
.noUi-handle {
position: relative;
position: absolute;
}
.noUi-state-tap .noUi-connect,
.noUi-state-tap .noUi-origin {
Expand Down Expand Up @@ -85,6 +91,10 @@
left: -6px;
top: -17px;
}
html:not([dir="rtl"]) .noUi-horizontal .noUi-handle {
right: -17px;
left: auto;
}
/* Styling;
* Giving the connect element a border radius causes issues with using transform: scale
*/
Expand Down
18 changes: 14 additions & 4 deletions distribute/nouislider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! nouislider - 11.0.1 - 2018-01-20 18:00:49 */
/*! nouislider - 11.0.2 - 2018-01-20 18:05:29 */

(function (factory) {

Expand All @@ -22,7 +22,7 @@

'use strict';

var VERSION = '11.0.1';
var VERSION = '11.0.2';


function isValidFormatter ( entry ) {
Expand Down Expand Up @@ -951,6 +951,10 @@ function closure ( target, options, originalOptions ){
var scope_DocumentElement = scope_Document.documentElement;
var scope_Body = scope_Document.body;

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


// Creates a node, adds it to target, returns the new node.
function addNodeTo ( target, className ) {
Expand Down Expand Up @@ -1509,6 +1513,12 @@ function closure ( target, options, originalOptions ){
function calcPointToPercentage ( calcPoint ) {
var location = calcPoint - offset(scope_Base, options.ort);
var proposal = ( location * 100 ) / baseSize();

// Clamp proposal between 0% and 100%
// Out-of-bound coordinates may occur when .noUi-base pseudo-elements
// are used (e.g. contained handles feature)
proposal = limit(proposal);

return options.dir ? 100 - proposal : proposal;
}

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

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

if ( pos < closest ) {
if ( pos < closest || (pos === 100 && closest === 100) ) {
handleNumber = index;
closest = pos;
}
Expand Down Expand Up @@ -1965,7 +1975,7 @@ function closure ( target, options, originalOptions ){
// Convert the value to the slider stepping/range.
scope_Values[handleNumber] = scope_Spectrum.fromStepping(to);

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

updateConnect(handleNumber);
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": "11.0.1",
"version": "11.0.2",
"main": "distribute/nouislider",
"style": "distribute/nouislider.min.css",
"license": "WTFPL",
Expand Down

0 comments on commit f75b661

Please sign in to comment.