Skip to content

Commit

Permalink
Update to 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
IonDen committed Dec 12, 2016
1 parent 15089a8 commit c5dc234
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 101 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.4",
"version": "2.1.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
Expand Up @@ -2,6 +2,9 @@

# Update History

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

### Version 2.1.4. April 27, 2016
* Issues: #330, #369

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.4 | *Version 3.x is under developement now*
* Version: 2.1.5 | *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.4.zip">Download ZIP</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.5.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.4",
"version": "2.1.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.1.4.zip",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.5.zip",
"dependencies": {
"jquery": ">=1.8"
}
Expand Down
73 changes: 45 additions & 28 deletions js/ion.rangeSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ion.RangeSlider
// version 2.1.4 Build: 355
// version 2.1.5 Build: 365
// © Denis Ineshin, 2016
// https://github.com/IonDen
//
Expand All @@ -10,11 +10,13 @@
// http://ionden.com/a/plugins/licence-en.html
// =====================================================================================================================

(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], function ($) {
factory($, document, window, navigator);
;(function(factory) {
if (typeof define === "function" && define.amd) {
define(["jquery"], function (jQuery) {
return factory(jQuery, document, window, navigator);
});
} else if (typeof exports === "object") {
factory(require("jquery"), document, window, navigator);
} else {
factory(jQuery, document, window, navigator);
}
Expand Down Expand Up @@ -154,7 +156,7 @@
* @constructor
*/
var IonRangeSlider = function (input, options, plugin_count) {
this.VERSION = "2.1.4";
this.VERSION = "2.1.5";
this.input = input;
this.plugin_count = plugin_count;
this.current_plugin = 0;
Expand All @@ -176,6 +178,8 @@
this.is_resize = false;
this.is_click = false;

options = options || {};

// cache for links to all DOM elements
this.$cache = {
win: $(window),
Expand Down Expand Up @@ -384,7 +388,7 @@

for (prop in config_from_data) {
if (config_from_data.hasOwnProperty(prop)) {
if (!config_from_data[prop] && config_from_data[prop] !== 0) {
if (config_from_data[prop] === undefined || config_from_data[prop] === "") {
delete config_from_data[prop];
}
}
Expand All @@ -393,7 +397,7 @@


// input value extends default config
if (val) {
if (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 @@ -425,6 +429,7 @@


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


Expand Down Expand Up @@ -456,7 +461,7 @@
/**
* Starts or updates the plugin instance
*
* @param is_update {boolean}
* @param [is_update] {boolean}
*/
init: function (is_update) {
this.no_diapason = false;
Expand Down Expand Up @@ -743,7 +748,6 @@

// callbacks call
if ($.contains(this.$cache.cont[0], e.target) || this.dragging) {
this.is_finish = true;
this.callOnFinish();
}

Expand All @@ -769,7 +773,7 @@
}

if (!target) {
target = this.target;
target = this.target || "from";
}

this.current_plugin = this.plugin_count;
Expand Down Expand Up @@ -955,6 +959,12 @@
this.calcPointerPercent();
var handle_x = this.getHandleX();


if (this.target === "both") {
this.coords.p_gap = 0;
handle_x = this.getHandleX();
}

if (this.target === "click") {
this.coords.p_gap = this.coords.p_handle / 2;
handle_x = this.getHandleX();
Expand Down Expand Up @@ -1042,7 +1052,7 @@
break;
}

handle_x = this.toFixed(handle_x + (this.coords.p_handle * 0.1));
handle_x = this.toFixed(handle_x + (this.coords.p_handle * 0.001));

this.coords.p_from_real = this.convertToRealPercent(handle_x) - this.coords.p_gap_left;
this.coords.p_from_real = this.calcWithStep(this.coords.p_from_real);
Expand Down Expand Up @@ -1894,32 +1904,37 @@
o.from = o.min;
}

if (typeof o.to !== "number" || isNaN(o.from)) {
if (typeof o.to !== "number" || isNaN(o.to)) {
o.to = o.max;
}

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

if (o.from < o.min) {
o.from = o.min;
}

if (o.from > o.max) {
o.from = o.max;
}
if (o.from < o.min) o.from = o.min;
if (o.from > o.max) o.from = o.max;

} else {

if (o.from < o.min || o.from > o.max) {
o.from = o.min;
}
if (o.to > o.max || o.to < o.min) {
o.to = o.max;
}
if (o.from > o.to) {
o.from = o.to;
if (o.from < o.min) o.from = o.min;
if (o.from > o.max) o.from = o.max;

if (o.to < o.min) o.to = o.min;
if (o.to > o.max) o.to = o.max;

if (this.update_check.from) {

if (this.update_check.from !== o.from) {
if (o.from > o.to) o.from = o.to;
}
if (this.update_check.to !== o.to) {
if (o.to < o.from) o.to = o.from;
}

}

if (o.from > o.to) o.from = o.to;
if (o.to < o.from) o.to = o.from;

}

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

this.options.from = this.result.from;
this.options.to = this.result.to;
this.update_check.from = this.result.from;
this.update_check.to = this.result.to;

this.options = $.extend(this.options, options);
this.validate();
Expand Down
Loading

0 comments on commit c5dc234

Please sign in to comment.