Skip to content

Commit c5dc234

Browse files
committed
Update to 2.1.5
1 parent 15089a8 commit c5dc234

9 files changed

+123
-101
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.4",
3+
"version": "2.1.5",
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.5. December 12, 2016
6+
* Issues: #331, #332, #333, #337, #338, #343, #358, #374, #380, #389, #390, #394, #411, #412, #413
7+
58
### Version 2.1.4. April 27, 2016
69
* Issues: #330, #369
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.4 | *Version 3.x is under developement now*
9+
* Version: 2.1.5 | *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.4.zip">Download ZIP</a>
11+
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.5.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.4",
3+
"version": "2.1.5",
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.4.zip",
33+
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.5.zip",
3434
"dependencies": {
3535
"jquery": ">=1.8"
3636
}

js/ion.rangeSlider.js

+45-28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Ion.RangeSlider
2-
// version 2.1.4 Build: 355
2+
// version 2.1.5 Build: 365
33
// © Denis Ineshin, 2016
44
// https://github.com/IonDen
55
//
@@ -10,11 +10,13 @@
1010
// http://ionden.com/a/plugins/licence-en.html
1111
// =====================================================================================================================
1212

13-
(function (factory) {
14-
if (typeof define === 'function' && define.amd) {
15-
define(['jquery'], function ($) {
16-
factory($, document, window, navigator);
13+
;(function(factory) {
14+
if (typeof define === "function" && define.amd) {
15+
define(["jquery"], function (jQuery) {
16+
return factory(jQuery, document, window, navigator);
1717
});
18+
} else if (typeof exports === "object") {
19+
factory(require("jquery"), document, window, navigator);
1820
} else {
1921
factory(jQuery, document, window, navigator);
2022
}
@@ -154,7 +156,7 @@
154156
* @constructor
155157
*/
156158
var IonRangeSlider = function (input, options, plugin_count) {
157-
this.VERSION = "2.1.4";
159+
this.VERSION = "2.1.5";
158160
this.input = input;
159161
this.plugin_count = plugin_count;
160162
this.current_plugin = 0;
@@ -176,6 +178,8 @@
176178
this.is_resize = false;
177179
this.is_click = false;
178180

181+
options = options || {};
182+
179183
// cache for links to all DOM elements
180184
this.$cache = {
181185
win: $(window),
@@ -384,7 +388,7 @@
384388

385389
for (prop in config_from_data) {
386390
if (config_from_data.hasOwnProperty(prop)) {
387-
if (!config_from_data[prop] && config_from_data[prop] !== 0) {
391+
if (config_from_data[prop] === undefined || config_from_data[prop] === "") {
388392
delete config_from_data[prop];
389393
}
390394
}
@@ -393,7 +397,7 @@
393397

394398

395399
// input value extends default config
396-
if (val) {
400+
if (val !== "") {
397401
val = val.split(config_from_data.input_values_separator || options.input_values_separator || ";");
398402

399403
if (val[0] && val[0] == +val[0]) {
@@ -425,6 +429,7 @@
425429

426430

427431
// validate config, to be sure that all data types are correct
432+
this.update_check = {};
428433
this.validate();
429434

430435

@@ -456,7 +461,7 @@
456461
/**
457462
* Starts or updates the plugin instance
458463
*
459-
* @param is_update {boolean}
464+
* @param [is_update] {boolean}
460465
*/
461466
init: function (is_update) {
462467
this.no_diapason = false;
@@ -743,7 +748,6 @@
743748

744749
// callbacks call
745750
if ($.contains(this.$cache.cont[0], e.target) || this.dragging) {
746-
this.is_finish = true;
747751
this.callOnFinish();
748752
}
749753

@@ -769,7 +773,7 @@
769773
}
770774

771775
if (!target) {
772-
target = this.target;
776+
target = this.target || "from";
773777
}
774778

775779
this.current_plugin = this.plugin_count;
@@ -955,6 +959,12 @@
955959
this.calcPointerPercent();
956960
var handle_x = this.getHandleX();
957961

962+
963+
if (this.target === "both") {
964+
this.coords.p_gap = 0;
965+
handle_x = this.getHandleX();
966+
}
967+
958968
if (this.target === "click") {
959969
this.coords.p_gap = this.coords.p_handle / 2;
960970
handle_x = this.getHandleX();
@@ -1042,7 +1052,7 @@
10421052
break;
10431053
}
10441054

1045-
handle_x = this.toFixed(handle_x + (this.coords.p_handle * 0.1));
1055+
handle_x = this.toFixed(handle_x + (this.coords.p_handle * 0.001));
10461056

10471057
this.coords.p_from_real = this.convertToRealPercent(handle_x) - this.coords.p_gap_left;
10481058
this.coords.p_from_real = this.calcWithStep(this.coords.p_from_real);
@@ -1894,32 +1904,37 @@
18941904
o.from = o.min;
18951905
}
18961906

1897-
if (typeof o.to !== "number" || isNaN(o.from)) {
1907+
if (typeof o.to !== "number" || isNaN(o.to)) {
18981908
o.to = o.max;
18991909
}
19001910

19011911
if (o.type === "single") {
19021912

1903-
if (o.from < o.min) {
1904-
o.from = o.min;
1905-
}
1906-
1907-
if (o.from > o.max) {
1908-
o.from = o.max;
1909-
}
1913+
if (o.from < o.min) o.from = o.min;
1914+
if (o.from > o.max) o.from = o.max;
19101915

19111916
} else {
19121917

1913-
if (o.from < o.min || o.from > o.max) {
1914-
o.from = o.min;
1915-
}
1916-
if (o.to > o.max || o.to < o.min) {
1917-
o.to = o.max;
1918-
}
1919-
if (o.from > o.to) {
1920-
o.from = o.to;
1918+
if (o.from < o.min) o.from = o.min;
1919+
if (o.from > o.max) o.from = o.max;
1920+
1921+
if (o.to < o.min) o.to = o.min;
1922+
if (o.to > o.max) o.to = o.max;
1923+
1924+
if (this.update_check.from) {
1925+
1926+
if (this.update_check.from !== o.from) {
1927+
if (o.from > o.to) o.from = o.to;
1928+
}
1929+
if (this.update_check.to !== o.to) {
1930+
if (o.to < o.from) o.to = o.from;
1931+
}
1932+
19211933
}
19221934

1935+
if (o.from > o.to) o.from = o.to;
1936+
if (o.to < o.from) o.to = o.from;
1937+
19231938
}
19241939

19251940
if (typeof o.step !== "number" || isNaN(o.step) || !o.step || o.step < 0) {
@@ -2242,6 +2257,8 @@
22422257

22432258
this.options.from = this.result.from;
22442259
this.options.to = this.result.to;
2260+
this.update_check.from = this.result.from;
2261+
this.update_check.to = this.result.to;
22452262

22462263
this.options = $.extend(this.options, options);
22472264
this.validate();

0 commit comments

Comments
 (0)