Skip to content

Commit

Permalink
Update to 2.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
IonDen committed Dec 27, 2016
1 parent 1de0251 commit 6c7c96b
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 62 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ion.rangeSlider",
"version": "2.1.5",
"version": "2.1.6",
"homepage": "https://github.com/IonDen/ion.rangeSlider",
"authors": [
{
Expand Down
3 changes: 3 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# Update History

### Version 2.1.6. December 27, 2016
* Issues: #393, #406, #429, #431, #432

### Version 2.1.5. December 12, 2016
* Issues: #331, #332, #333, #337, #338, #343, #358, #374, #380, #389, #390, #394, #411, #412, #413

Expand Down
4 changes: 2 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Ion.RangeSlider. Is an easy, flexible and responsive range slider with tons of o

***

* Version: 2.1.5 | *Version 3.x is under developement now*
* Version: 2.1.6 | *Version 3.x is under developement now*
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/en.html">Project page and demos</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.5.zip">Download ZIP</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.6.zip">Download ZIP</a>

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

Expand Down
4 changes: 2 additions & 2 deletions ion-rangeSlider.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ion-rangeSlider",
"version": "2.1.5",
"version": "2.1.6",
"title": "Ion.RangeSlider",
"description": "Cool, comfortable and easily customizable range slider with many options and skin support",
"keywords": [
Expand Down Expand Up @@ -30,7 +30,7 @@
"homepage": "https://github.com/IonDen/ion.rangeSlider",
"docs": "https://github.com/IonDen/ion.rangeSlider/blob/master/readme.md",
"demo": "http://ionden.com/a/plugins/ion.rangeSlider/en.html",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.5.zip",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.6.zip",
"dependencies": {
"jquery": ">=1.8"
}
Expand Down
63 changes: 44 additions & 19 deletions js/ion.rangeSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ion.RangeSlider
// version 2.1.5 Build: 365
// version 2.1.6 Build: 369
// © Denis Ineshin, 2016
// https://github.com/IonDen
//
Expand Down Expand Up @@ -156,7 +156,7 @@
* @constructor
*/
var IonRangeSlider = function (input, options, plugin_count) {
this.VERSION = "2.1.5";
this.VERSION = "2.1.6";
this.input = input;
this.plugin_count = plugin_count;
this.current_plugin = 0;
Expand Down Expand Up @@ -331,6 +331,11 @@
};


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


// config from data-attributes extends js config
config_from_data = {
Expand Down Expand Up @@ -395,9 +400,8 @@
}



// input value extends default config
if (val !== "") {
if (val !== undefined && val !== "") {
val = val.split(config_from_data.input_values_separator || options.input_values_separator || ";");

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

this.$cache.single[0].style.left = this.labels.p_single_left + "%";

if (this.options.values.length) {
this.$cache.input.prop("value", this.result.from_value);
} else {
this.$cache.input.prop("value", this.result.from);
}
this.$cache.input.data("from", this.result.from);
} else {
this.$cache.s_from[0].style.left = this.coords.p_from_fake + "%";
this.$cache.s_to[0].style.left = this.coords.p_to_fake + "%";
Expand All @@ -1349,18 +1346,13 @@
}

this.$cache.single[0].style.left = this.labels.p_single_left + "%";

if (this.options.values.length) {
this.$cache.input.prop("value", this.result.from_value + this.options.input_values_separator + this.result.to_value);
} else {
this.$cache.input.prop("value", this.result.from + this.options.input_values_separator + this.result.to);
}
this.$cache.input.data("from", this.result.from);
this.$cache.input.data("to", this.result.to);
}

this.writeToInput();

if ((this.old_from !== this.result.from || this.old_to !== this.result.to) && !this.is_start) {
this.$cache.input.trigger("change");
this.$cache.input.trigger("input");
}

this.old_from = this.result.from;
Expand Down Expand Up @@ -1581,32 +1573,65 @@



/**
* Write values to input element
*/
writeToInput: function () {
if (this.options.type === "single") {
if (this.options.values.length) {
this.$cache.input.prop("value", this.result.from_value);
} else {
this.$cache.input.prop("value", this.result.from);
}
this.$cache.input.data("from", this.result.from);
} else {
if (this.options.values.length) {
this.$cache.input.prop("value", this.result.from_value + this.options.input_values_separator + this.result.to_value);
} else {
this.$cache.input.prop("value", this.result.from + this.options.input_values_separator + this.result.to);
}
this.$cache.input.data("from", this.result.from);
this.$cache.input.data("to", this.result.to);
}
},



// =============================================================================================================
// Callbacks

callOnStart: function () {
this.writeToInput();

if (this.options.onStart && typeof this.options.onStart === "function") {
this.options.onStart(this.result);
}
},
callOnChange: function () {
this.writeToInput();

if (this.options.onChange && typeof this.options.onChange === "function") {
this.options.onChange(this.result);
}
},
callOnFinish: function () {
this.writeToInput();

if (this.options.onFinish && typeof this.options.onFinish === "function") {
this.options.onFinish(this.result);
}
},
callOnUpdate: function () {
this.writeToInput();

if (this.options.onUpdate && typeof this.options.onUpdate === "function") {
this.options.onUpdate(this.result);
}
},




// =============================================================================================================
// Service methods

Expand Down
Loading

0 comments on commit 6c7c96b

Please sign in to comment.