Skip to content

Commit

Permalink
Release v10.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jespirit committed Dec 12, 2018
1 parent 41971c5 commit 88dfe2a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "seiyria-bootstrap-slider",
"version": "10.3.4",
"version": "10.4.0",
"homepage": "https://github.com/seiyria/bootstrap-slider",
"authors": [
"Kyle Kemp <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "seiyria/bootstrap-slider",
"type": "library",
"version": "10.3.4",
"version": "10.4.0",
"description": "A less buggy fork of the original bootstrap slider found on http://www.eyecon.ro/ by Stefan Petre. It was forked so we could update the slider since the original wasn't under version control.",
"keywords": ["slider", "css", "bootstrap", "javascript"],
"homepage": "https://github.com/seiyria/bootstrap-slider",
Expand Down
33 changes: 20 additions & 13 deletions dist/bootstrap-slider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! =======================================================
VERSION 10.3.4
VERSION 10.4.0
========================================================= */
"use strict";

Expand Down Expand Up @@ -365,6 +365,9 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
options = options ? options : {};
var optionTypes = Object.keys(this.defaultOptions);

var isMinSet = options.hasOwnProperty('min');
var isMaxSet = options.hasOwnProperty('max');

for (var i = 0; i < optionTypes.length; i++) {
var optName = optionTypes[i];

Expand Down Expand Up @@ -678,8 +681,12 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
this._setTooltipPosition();
/* In case ticks are specified, overwrite the min and max bounds */
if (Array.isArray(this.options.ticks) && this.options.ticks.length > 0) {
this.options.max = Math.max.apply(Math, this.options.ticks);
this.options.min = Math.min.apply(Math, this.options.ticks);
if (!isMaxSet) {
this.options.max = Math.max.apply(Math, this.options.ticks);
}
if (!isMinSet) {
this.options.min = Math.min.apply(Math, this.options.ticks);
}
}

if (Array.isArray(this.options.value)) {
Expand Down Expand Up @@ -1466,7 +1473,6 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
}

this._state.percentage[this._state.dragged] = percentage;
this._layout();

if (this.touchCapable) {
document.removeEventListener("touchmove", this.mousemove, false);
Expand Down Expand Up @@ -1497,7 +1503,6 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win

this._trigger('slideStart', newValue);

this._setDataVal(newValue);
this.setValue(newValue, false, true);

ev.returnValue = false;
Expand Down Expand Up @@ -1559,7 +1564,7 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
}

var val = this._state.value[handleIdx] + dir * this.options.step;
var percentage = val / this.options.max * 100;
var percentage = this._toPercentage(val);
this._state.keyCtrl = handleIdx;
if (this.options.range) {
this._adjustPercentageForRangeSliders(percentage);
Expand All @@ -1572,12 +1577,10 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
}

this._trigger('slideStart', val);
this._setDataVal(val);

this.setValue(val, true, true);

this._setDataVal(val);
this._trigger('slideStop', val);
this._layout();

this._pauseEvent(ev);
delete this._state.keyCtrl;
Expand All @@ -1602,7 +1605,6 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
var percentage = this._getPercentage(ev);
this._adjustPercentageForRangeSliders(percentage);
this._state.percentage[this._state.dragged] = percentage;
this._layout();

var val = this._calculateValue(true);
this.setValue(val, true, true);
Expand Down Expand Up @@ -1641,21 +1643,26 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
} else if (this._state.dragged === 1 && this._applyToFixedAndParseFloat(this._state.percentage[0], precision) > percentageWithAdjustedPrecision) {
this._state.percentage[1] = this._state.percentage[0];
this._state.dragged = 0;
} else if (this._state.keyCtrl === 0 && this._state.value[1] / this.options.max * 100 < percentage) {
} else if (this._state.keyCtrl === 0 && this._toPercentage(this._state.value[1]) < percentage) {
this._state.percentage[0] = this._state.percentage[1];
this._state.keyCtrl = 1;
this.handle2.focus();
} else if (this._state.keyCtrl === 1 && this._state.value[0] / this.options.max * 100 > percentage) {
} else if (this._state.keyCtrl === 1 && this._toPercentage(this._state.value[0]) > percentage) {
this._state.percentage[1] = this._state.percentage[0];
this._state.keyCtrl = 0;
this.handle1.focus();
}
}
},
_mouseup: function _mouseup() {
_mouseup: function _mouseup(ev) {
if (!this._state.enabled) {
return false;
}

var percentage = this._getPercentage(ev);
this._adjustPercentageForRangeSliders(percentage);
this._state.percentage[this._state.dragged] = percentage;

if (this.touchCapable) {
// Touch: Unbind touch event handlers:
document.removeEventListener("touchmove", this.mousemove, false);
Expand Down
6 changes: 3 additions & 3 deletions dist/bootstrap-slider.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap-slider.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! =======================================================
VERSION 10.3.4
VERSION 10.4.0
========================================================= */
/*! =========================================================
* bootstrap-slider.js
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap-slider.min.css

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": "bootstrap-slider",
"version": "10.3.4",
"version": "10.4.0",
"description": "Slider view component for Twitter Bootstrap.",
"main": "dist/bootstrap-slider.js",
"style": "dist/css/bootstrap-slider.css",
Expand Down

0 comments on commit 88dfe2a

Please sign in to comment.