Skip to content

Commit

Permalink
Update to 2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
IonDen committed Feb 13, 2015
1 parent 627170b commit 79eb2c0
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 48 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.0.4",
"version": "2.0.5",
"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
@@ -1,5 +1,8 @@
# Ion.RangeSlider Update History

### Version 2.0.5. February 13, 2015
* Issues done: #193, #195, #197, #201

### Version 2.0.4. February 12, 2015
* Issues done: #174, #184
* NPM support added
Expand Down
4 changes: 2 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Ion.Range Slider 2.0.4
# Ion.Range Slider 2.0.5

> English description | <a href="readme.ru.md">Описание на русском</a>
Easy and light range slider
* <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.0.4.zip">Download ion.rangeSlider-2.0.4.zip</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.5.zip">Download ion.rangeSlider-2.0.5.zip</a>

***

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.0.4",
"version": "2.0.5",
"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.0.4.zip",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.5.zip",
"dependencies": {
"jquery": ">=1.8"
}
Expand Down
30 changes: 25 additions & 5 deletions js/ion.rangeSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ion.RangeSlider
// version 2.0.4 Build: 296
// version 2.0.5 Build: 298
// © Denis Ineshin, 2015
// https://github.com/IonDen
//
Expand Down Expand Up @@ -111,7 +111,7 @@
// Core

var IonRangeSlider = function (input, options, plugin_count) {
this.VERSION = "2.0.3";
this.VERSION = "2.0.5";
this.input = input;
this.plugin_count = plugin_count;
this.current_plugin = 0;
Expand Down Expand Up @@ -205,6 +205,20 @@
data.values = data.values && data.values.split(",");
options = $.extend(data, options);

// get from and to out of input
var val = $inp.prop("value");
if (val) {
val = val.split(";");
}

if (val && options.values && options.values.length) {
data.from = val[0] && options.values.indexOf(val[0]);
data.to = val[1] && options.values.indexOf(val[1]);
} else {
data.from = val[0] && +val[0];
data.to = val[1] && +val[1];
}

// get config from options
this.options = $.extend({
type: "single",
Expand Down Expand Up @@ -1128,13 +1142,19 @@
drawShadow: function () {
var o = this.options,
c = this.$cache,

is_from_min = typeof o.from_min === "number" && !isNaN(o.from_min),
is_from_max = typeof o.from_max === "number" && !isNaN(o.from_max),
is_to_min = typeof o.to_min === "number" && !isNaN(o.to_min),
is_to_max = typeof o.to_max === "number" && !isNaN(o.to_max),

from_min,
from_max,
to_min,
to_max;

if (o.type === "single") {
if (o.from_shadow && (o.from_min || o.from_max)) {
if (o.from_shadow && (is_from_min || is_from_max)) {
from_min = this.calcPercent(o.from_min || o.min);
from_max = this.calcPercent(o.from_max || o.max) - from_min;
from_min = this.toFixed(from_min - (this.coords.p_handle / 100 * from_min));
Expand All @@ -1148,7 +1168,7 @@
c.shad_single[0].style.display = "none";
}
} else {
if (o.from_shadow && (o.from_min || o.from_max)) {
if (o.from_shadow && (is_from_min || is_from_max)) {
from_min = this.calcPercent(o.from_min || o.min);
from_max = this.calcPercent(o.from_max || o.max) - from_min;
from_min = this.toFixed(from_min - (this.coords.p_handle / 100 * from_min));
Expand All @@ -1162,7 +1182,7 @@
c.shad_from[0].style.display = "none";
}

if (o.to_shadow && (o.to_min || o.to_max)) {
if (o.to_shadow && (is_to_min || is_to_max)) {
to_min = this.calcPercent(o.to_min || o.min);
to_max = this.calcPercent(o.to_max || o.max) - to_min;
to_min = this.toFixed(to_min - (this.coords.p_handle / 100 * to_min));
Expand Down
67 changes: 34 additions & 33 deletions js/ion.rangeSlider.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ion-rangeslider",
"version": "2.0.4",
"version": "2.0.5",
"description": "Cool, comfortable and easily customizable range slider with many options and skin support",
"homepage": "http://ionden.com/a/plugins/ion.rangeSlider/en.html",
"author": {
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Ion.Range Slider 2.0.4
# Ion.Range Slider 2.0.5

> English description | <a href="readme.ru.md">Описание на русском</a>
Easy and light range slider
* <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.0.4.zip">Download ion.rangeSlider-2.0.4.zip</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.5.zip">Download ion.rangeSlider-2.0.5.zip</a>

***

Expand Down
4 changes: 2 additions & 2 deletions readme.ru.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Ion.Range Slider 2.0.4
# Ion.Range Slider 2.0.5

> <a href="readme.md">English description</a> | Описание на русском
Удобный легкий слайдер диапазонов
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/index.html">Страница проекта и демо</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.4.zip">Download ion.rangeSlider-2.0.4.zip</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.5.zip">Download ion.rangeSlider-2.0.5.zip</a>

***

Expand Down

0 comments on commit 79eb2c0

Please sign in to comment.