Skip to content

Commit 6c7c96b

Browse files
committed
Update to 2.1.6
1 parent 1de0251 commit 6c7c96b

9 files changed

+90
-62
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ion.rangeSlider",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"homepage": "https://github.com/IonDen/ion.rangeSlider",
55
"authors": [
66
{

history.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# Update History
44

5+
### Version 2.1.6. December 27, 2016
6+
* Issues: #393, #406, #429, #431, #432
7+
58
### Version 2.1.5. December 12, 2016
69
* Issues: #331, #332, #333, #337, #338, #343, #358, #374, #380, #389, #390, #394, #411, #412, #413
710

index.md

+2-2
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.5 | *Version 3.x is under developement now*
9+
* Version: 2.1.6 | *Version 3.x is under developement now*
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.5.zip">Download ZIP</a>
11+
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.6.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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ion-rangeSlider",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
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.5.zip",
33+
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.6.zip",
3434
"dependencies": {
3535
"jquery": ">=1.8"
3636
}

js/ion.rangeSlider.js

+44-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Ion.RangeSlider
2-
// version 2.1.5 Build: 365
2+
// version 2.1.6 Build: 369
33
// © Denis Ineshin, 2016
44
// https://github.com/IonDen
55
//
@@ -156,7 +156,7 @@
156156
* @constructor
157157
*/
158158
var IonRangeSlider = function (input, options, plugin_count) {
159-
this.VERSION = "2.1.5";
159+
this.VERSION = "2.1.6";
160160
this.input = input;
161161
this.plugin_count = plugin_count;
162162
this.current_plugin = 0;
@@ -331,6 +331,11 @@
331331
};
332332

333333

334+
// check if base element is input
335+
if ($inp[0].nodeName !== "INPUT") {
336+
console && console.warn && console.warn("Base element should be <input>!", $inp[0]);
337+
}
338+
334339

335340
// config from data-attributes extends js config
336341
config_from_data = {
@@ -395,9 +400,8 @@
395400
}
396401

397402

398-
399403
// input value extends default config
400-
if (val !== "") {
404+
if (val !== undefined && val !== "") {
401405
val = val.split(config_from_data.input_values_separator || options.input_values_separator || ";");
402406

403407
if (val[0] && val[0] == +val[0]) {
@@ -1330,13 +1334,6 @@
13301334
this.$cache.s_single[0].style.left = this.coords.p_single_fake + "%";
13311335

13321336
this.$cache.single[0].style.left = this.labels.p_single_left + "%";
1333-
1334-
if (this.options.values.length) {
1335-
this.$cache.input.prop("value", this.result.from_value);
1336-
} else {
1337-
this.$cache.input.prop("value", this.result.from);
1338-
}
1339-
this.$cache.input.data("from", this.result.from);
13401337
} else {
13411338
this.$cache.s_from[0].style.left = this.coords.p_from_fake + "%";
13421339
this.$cache.s_to[0].style.left = this.coords.p_to_fake + "%";
@@ -1349,18 +1346,13 @@
13491346
}
13501347

13511348
this.$cache.single[0].style.left = this.labels.p_single_left + "%";
1352-
1353-
if (this.options.values.length) {
1354-
this.$cache.input.prop("value", this.result.from_value + this.options.input_values_separator + this.result.to_value);
1355-
} else {
1356-
this.$cache.input.prop("value", this.result.from + this.options.input_values_separator + this.result.to);
1357-
}
1358-
this.$cache.input.data("from", this.result.from);
1359-
this.$cache.input.data("to", this.result.to);
13601349
}
13611350

1351+
this.writeToInput();
1352+
13621353
if ((this.old_from !== this.result.from || this.old_to !== this.result.to) && !this.is_start) {
13631354
this.$cache.input.trigger("change");
1355+
this.$cache.input.trigger("input");
13641356
}
13651357

13661358
this.old_from = this.result.from;
@@ -1581,32 +1573,65 @@
15811573

15821574

15831575

1576+
/**
1577+
* Write values to input element
1578+
*/
1579+
writeToInput: function () {
1580+
if (this.options.type === "single") {
1581+
if (this.options.values.length) {
1582+
this.$cache.input.prop("value", this.result.from_value);
1583+
} else {
1584+
this.$cache.input.prop("value", this.result.from);
1585+
}
1586+
this.$cache.input.data("from", this.result.from);
1587+
} else {
1588+
if (this.options.values.length) {
1589+
this.$cache.input.prop("value", this.result.from_value + this.options.input_values_separator + this.result.to_value);
1590+
} else {
1591+
this.$cache.input.prop("value", this.result.from + this.options.input_values_separator + this.result.to);
1592+
}
1593+
this.$cache.input.data("from", this.result.from);
1594+
this.$cache.input.data("to", this.result.to);
1595+
}
1596+
},
1597+
1598+
1599+
15841600
// =============================================================================================================
15851601
// Callbacks
15861602

15871603
callOnStart: function () {
1604+
this.writeToInput();
1605+
15881606
if (this.options.onStart && typeof this.options.onStart === "function") {
15891607
this.options.onStart(this.result);
15901608
}
15911609
},
15921610
callOnChange: function () {
1611+
this.writeToInput();
1612+
15931613
if (this.options.onChange && typeof this.options.onChange === "function") {
15941614
this.options.onChange(this.result);
15951615
}
15961616
},
15971617
callOnFinish: function () {
1618+
this.writeToInput();
1619+
15981620
if (this.options.onFinish && typeof this.options.onFinish === "function") {
15991621
this.options.onFinish(this.result);
16001622
}
16011623
},
16021624
callOnUpdate: function () {
1625+
this.writeToInput();
1626+
16031627
if (this.options.onUpdate && typeof this.options.onUpdate === "function") {
16041628
this.options.onUpdate(this.result);
16051629
}
16061630
},
16071631

16081632

16091633

1634+
16101635
// =============================================================================================================
16111636
// Service methods
16121637

0 commit comments

Comments
 (0)