diff --git a/README.md b/README.md index b8e0567b..a21b7370 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,11 @@ An extensive documentation, including **examples**, **options** and **configurat Changelog --------- -### 8.5.0 (latest) +### 8.5.1 (latest) +- Fix: class mixup in 8.5.0 merge +- Change: position pips markers relatively + +### 8.5.0 - Added: ability to completely override the classes used by the slider - Fix: removed invalid stopPropagation loop - Fix: source properly lints diff --git a/distribute/nouislider.js b/distribute/nouislider.js index 88691c4b..4b6f6e27 100644 --- a/distribute/nouislider.js +++ b/distribute/nouislider.js @@ -1,4 +1,4 @@ -/*! nouislider - 8.5.0 - 2016-04-24 14:53:53 */ +/*! nouislider - 8.5.1 - 2016-04-24 16:00:29 */ (function (factory) { @@ -760,7 +760,12 @@ markerNormal: 'marker-normal', markerLarge: 'marker-large', markerSub: 'marker-sub', - value: 'value' + value: 'value', + valueHorizontal: 'value-horizontal', + valueVertical: 'value-vertical', + valueNormal: 'value-normal', + valueLarge: 'value-large', + valueSub: 'value-sub' } }; @@ -1147,35 +1152,40 @@ function closure ( target, options, originalOptions ){ function addMarking ( spread, filterFunc, formatter ) { - var classPips, classMarker, - element = document.createElement('div'), - out = ''; + var element = document.createElement('div'), + out = '', + valueSizeClasses = [ + options.cssClasses.valueNormal, + options.cssClasses.valueLarge, + options.cssClasses.valueSub + ], + markerSizeClasses = [ + options.cssClasses.markerNormal, + options.cssClasses.markerLarge, + options.cssClasses.markerSub + ], + valueOrientationClasses = [ + options.cssClasses.valueHorizontal, + options.cssClasses.valueVertical + ], + markerOrientationClasses = [ + options.cssClasses.markerHorizontal, + options.cssClasses.markerVertical + ]; addClass(element, options.cssClasses.pips); + addClass(element, options.ort === 0 ? options.cssClasses.pipsHorizontal : options.cssClasses.pipsVertical); - if ( options.ort === 0 ) { - classPips = options.cssClasses.pipsHorizontal; - classMarker = options.cssClasses.markerHorizontal; - } else { - classPips = options.cssClasses.pipsVertical; - classMarker = options.cssClasses.markerVertical; - } - - addClass(element, classPips); + function getClasses( type, source ){ + var a = source === options.cssClasses.value, + orientationClasses = a ? valueOrientationClasses : markerOrientationClasses, + sizeClasses = a ? valueSizeClasses : markerSizeClasses; - function getSizeClass( type ){ - return [ - options.cssClasses.markerNormal, - options.cssClasses.markerLarge, - options.cssClasses.markerSub - ][type]; + return source + ' ' + orientationClasses[options.ort] + ' ' + sizeClasses[type]; } function getTags( offset, source, values ) { - return 'class="' + source + ' ' + - classMarker + ' ' + - getSizeClass(values[1]) + - '" style="' + options.style + ': ' + offset + '%"'; + return 'class="' + getClasses(values[1], source) + '" style="' + options.style + ': ' + offset + '%"'; } function addSpread ( offset, values ){ @@ -1192,7 +1202,7 @@ function closure ( target, options, originalOptions ){ // Values are only appended for points marked '1' or '2'. if ( values[1] ) { - out += '
noUiSlider is open source, and you can use it for free in any personal or commercial product. No attribution required. Both the uncompressed and compressed version of noUiSlider are available in a .zip
release, which is hosted by Github and available over https
.