Skip to content

Commit 83f68c9

Browse files
committed
Update to 2.1.2
1 parent 78f4599 commit 83f68c9

File tree

9 files changed

+78
-66
lines changed

9 files changed

+78
-66
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ion.rangeslider",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"homepage": "https://github.com/IonDen/ion.rangeSlider",
55
"authors": [
66
{

history.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# Update History
44

5+
### Version 2.1.2. October 13, 2015
6+
* Fixed bugs. Issues: #310, #312, #313, #316
7+
58
### Version 2.1.1. September 21, 2015
69
* Fixed bugs. Issues: #305
710
* New features. Requests: #282

index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Ion.RangeSlider. Is an easy, flexible and responsive range slider with tons of o
66

77
***
88

9-
* Version: 2.1.1
9+
* Version: 2.1.2
1010
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/en.html">Project page and demos</a>
11-
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.1.zip">Download ZIP</a>
11+
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.2.zip">Download ZIP</a>
1212

1313
[![](https://pledgie.com/campaigns/25694.png?skin_name=chrome)](https://pledgie.com/campaigns/25694)
1414

ion-rangeSlider.jquery.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ion-rangeSlider",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"title": "Ion.RangeSlider",
55
"description": "Cool, comfortable and easily customizable range slider with many options and skin support",
66
"keywords": [
@@ -30,7 +30,7 @@
3030
"homepage": "https://github.com/IonDen/ion.rangeSlider",
3131
"docs": "https://github.com/IonDen/ion.rangeSlider/blob/master/readme.md",
3232
"demo": "http://ionden.com/a/plugins/ion.rangeSlider/en.html",
33-
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.1.zip",
33+
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.2.zip",
3434
"dependencies": {
3535
"jquery": ">=1.8"
3636
}

js/ion.rangeSlider.js

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Ion.RangeSlider
2-
// version 2.1.1 Build: 347
2+
// version 2.1.2 Build: 350
33
// © Denis Ineshin, 2015
44
// https://github.com/IonDen
55
//
@@ -140,13 +140,13 @@
140140
/**
141141
* Main plugin constructor
142142
*
143-
* @param input {object} link to base input element
144-
* @param options {object} slider config
145-
* @param plugin_count {number}
143+
* @param input {Object} link to base input element
144+
* @param options {Object} slider config
145+
* @param plugin_count {Number}
146146
* @constructor
147147
*/
148148
var IonRangeSlider = function (input, options, plugin_count) {
149-
this.VERSION = "2.1.1";
149+
this.VERSION = "2.1.2";
150150
this.input = input;
151151
this.plugin_count = plugin_count;
152152
this.current_plugin = 0;
@@ -557,7 +557,7 @@
557557
* Determine which handles was clicked last
558558
* and which handler should have hover effect
559559
*
560-
* @param target {string}
560+
* @param target {String}
561561
*/
562562
changeLevel: function (target) {
563563
switch (target) {
@@ -659,8 +659,8 @@
659659
this.$cache.edge.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"));
660660
this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"));
661661
} else {
662-
this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
663-
this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
662+
this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, null));
663+
this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, null));
664664

665665
this.$cache.from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
666666
this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
@@ -691,7 +691,7 @@
691691
* Mousemove or touchmove
692692
* only for handlers
693693
*
694-
* @param e {object} event object
694+
* @param e {Object} event object
695695
*/
696696
pointerMove: function (e) {
697697
if (!this.dragging) {
@@ -708,7 +708,7 @@
708708
* Mouseup or touchend
709709
* only for handlers
710710
*
711-
* @param e {object} event object
711+
* @param e {Object} event object
712712
*/
713713
pointerUp: function (e) {
714714
if (this.current_plugin !== this.plugin_count) {
@@ -745,8 +745,8 @@
745745
* Mousedown or touchstart
746746
* only for handlers
747747
*
748-
* @param target {string}
749-
* @param e {object} event object
748+
* @param target {String|null}
749+
* @param e {Object} event object
750750
*/
751751
pointerDown: function (target, e) {
752752
e.preventDefault();
@@ -759,6 +759,10 @@
759759
this.setTempMinInterval();
760760
}
761761

762+
if (!target) {
763+
target = this.target;
764+
}
765+
762766
this.current_plugin = this.plugin_count;
763767
this.target = target;
764768

@@ -784,8 +788,8 @@
784788
* Mousedown or touchstart
785789
* for other slider elements, like diapason line
786790
*
787-
* @param target {string}
788-
* @param e {object} event object
791+
* @param target {String}
792+
* @param e {Object} event object
789793
*/
790794
pointerClick: function (target, e) {
791795
e.preventDefault();
@@ -810,8 +814,8 @@
810814
/**
811815
* Keyborard controls for focused slider
812816
*
813-
* @param target {string}
814-
* @param e {object} event object
817+
* @param target {String}
818+
* @param e {Object} event object
815819
* @returns {boolean|undefined}
816820
*/
817821
key: function (target, e) {
@@ -1163,8 +1167,8 @@
11631167
/**
11641168
* Find closest handle to pointer click
11651169
*
1166-
* @param real_x {number}
1167-
* @returns {string}
1170+
* @param real_x {Number}
1171+
* @returns {String}
11681172
*/
11691173
chooseHandle: function (real_x) {
11701174
if (this.options.type === "single") {
@@ -1457,11 +1461,16 @@
14571461
this.$cache.single[0].style.visibility = "visible";
14581462

14591463
if (this.result.from === this.result.to) {
1460-
this.$cache.from[0].style.visibility = "visible";
1464+
if (this.target === "from") {
1465+
this.$cache.from[0].style.visibility = "visible";
1466+
} else if (this.target === "to") {
1467+
this.$cache.to[0].style.visibility = "visible";
1468+
}
14611469
this.$cache.single[0].style.visibility = "hidden";
14621470
max = to_left;
14631471
} else {
14641472
this.$cache.from[0].style.visibility = "hidden";
1473+
this.$cache.to[0].style.visibility = "hidden";
14651474
this.$cache.single[0].style.visibility = "visible";
14661475
max = Math.max(single_left, to_left);
14671476
}
@@ -1586,9 +1595,9 @@
15861595
/**
15871596
* Convert real value to percent
15881597
*
1589-
* @param value {number} X in real
1598+
* @param value {Number} X in real
15901599
* @param no_min {boolean=} don't use min value
1591-
* @returns {number} X in percent
1600+
* @returns {Number} X in percent
15921601
*/
15931602
convertToPercent: function (value, no_min) {
15941603
var diapason = this.options.max - this.options.min,
@@ -1614,8 +1623,8 @@
16141623
/**
16151624
* Convert percent to real values
16161625
*
1617-
* @param percent {number} X in percent
1618-
* @returns {number} X in real
1626+
* @param percent {Number} X in percent
1627+
* @returns {Number} X in real
16191628
*/
16201629
convertToValue: function (percent) {
16211630
var min = this.options.min,
@@ -1687,8 +1696,8 @@
16871696
/**
16881697
* Round percent value with step
16891698
*
1690-
* @param percent {number}
1691-
* @returns percent {number} rounded
1699+
* @param percent {Number}
1700+
* @returns percent {Number} rounded
16921701
*/
16931702
calcWithStep: function (percent) {
16941703
var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step;

0 commit comments

Comments
 (0)