Skip to content

Commit

Permalink
Update to 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
IonDen committed Oct 13, 2015
1 parent 78f4599 commit 83f68c9
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 66 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.1",
"version": "2.1.2",
"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.2. October 13, 2015
* Fixed bugs. Issues: #310, #312, #313, #316

### Version 2.1.1. September 21, 2015
* Fixed bugs. Issues: #305
* New features. Requests: #282
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.1
* Version: 2.1.2
* <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.1.zip">Download ZIP</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.2.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.1",
"version": "2.1.2",
"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.1.zip",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.1.2.zip",
"dependencies": {
"jquery": ">=1.8"
}
Expand Down
59 changes: 34 additions & 25 deletions js/ion.rangeSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ion.RangeSlider
// version 2.1.1 Build: 347
// version 2.1.2 Build: 350
// © Denis Ineshin, 2015
// https://github.com/IonDen
//
Expand Down Expand Up @@ -140,13 +140,13 @@
/**
* Main plugin constructor
*
* @param input {object} link to base input element
* @param options {object} slider config
* @param plugin_count {number}
* @param input {Object} link to base input element
* @param options {Object} slider config
* @param plugin_count {Number}
* @constructor
*/
var IonRangeSlider = function (input, options, plugin_count) {
this.VERSION = "2.1.1";
this.VERSION = "2.1.2";
this.input = input;
this.plugin_count = plugin_count;
this.current_plugin = 0;
Expand Down Expand Up @@ -557,7 +557,7 @@
* Determine which handles was clicked last
* and which handler should have hover effect
*
* @param target {string}
* @param target {String}
*/
changeLevel: function (target) {
switch (target) {
Expand Down Expand Up @@ -659,8 +659,8 @@
this.$cache.edge.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"));
this.$cache.shad_single.on("mousedown.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"));
} else {
this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
this.$cache.single.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, null));
this.$cache.single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, null));

this.$cache.from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
this.$cache.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
Expand Down Expand Up @@ -691,7 +691,7 @@
* Mousemove or touchmove
* only for handlers
*
* @param e {object} event object
* @param e {Object} event object
*/
pointerMove: function (e) {
if (!this.dragging) {
Expand All @@ -708,7 +708,7 @@
* Mouseup or touchend
* only for handlers
*
* @param e {object} event object
* @param e {Object} event object
*/
pointerUp: function (e) {
if (this.current_plugin !== this.plugin_count) {
Expand Down Expand Up @@ -745,8 +745,8 @@
* Mousedown or touchstart
* only for handlers
*
* @param target {string}
* @param e {object} event object
* @param target {String|null}
* @param e {Object} event object
*/
pointerDown: function (target, e) {
e.preventDefault();
Expand All @@ -759,6 +759,10 @@
this.setTempMinInterval();
}

if (!target) {
target = this.target;
}

this.current_plugin = this.plugin_count;
this.target = target;

Expand All @@ -784,8 +788,8 @@
* Mousedown or touchstart
* for other slider elements, like diapason line
*
* @param target {string}
* @param e {object} event object
* @param target {String}
* @param e {Object} event object
*/
pointerClick: function (target, e) {
e.preventDefault();
Expand All @@ -810,8 +814,8 @@
/**
* Keyborard controls for focused slider
*
* @param target {string}
* @param e {object} event object
* @param target {String}
* @param e {Object} event object
* @returns {boolean|undefined}
*/
key: function (target, e) {
Expand Down Expand Up @@ -1163,8 +1167,8 @@
/**
* Find closest handle to pointer click
*
* @param real_x {number}
* @returns {string}
* @param real_x {Number}
* @returns {String}
*/
chooseHandle: function (real_x) {
if (this.options.type === "single") {
Expand Down Expand Up @@ -1457,11 +1461,16 @@
this.$cache.single[0].style.visibility = "visible";

if (this.result.from === this.result.to) {
this.$cache.from[0].style.visibility = "visible";
if (this.target === "from") {
this.$cache.from[0].style.visibility = "visible";
} else if (this.target === "to") {
this.$cache.to[0].style.visibility = "visible";
}
this.$cache.single[0].style.visibility = "hidden";
max = to_left;
} else {
this.$cache.from[0].style.visibility = "hidden";
this.$cache.to[0].style.visibility = "hidden";
this.$cache.single[0].style.visibility = "visible";
max = Math.max(single_left, to_left);
}
Expand Down Expand Up @@ -1586,9 +1595,9 @@
/**
* Convert real value to percent
*
* @param value {number} X in real
* @param value {Number} X in real
* @param no_min {boolean=} don't use min value
* @returns {number} X in percent
* @returns {Number} X in percent
*/
convertToPercent: function (value, no_min) {
var diapason = this.options.max - this.options.min,
Expand All @@ -1614,8 +1623,8 @@
/**
* Convert percent to real values
*
* @param percent {number} X in percent
* @returns {number} X in real
* @param percent {Number} X in percent
* @returns {Number} X in real
*/
convertToValue: function (percent) {
var min = this.options.min,
Expand Down Expand Up @@ -1687,8 +1696,8 @@
/**
* Round percent value with step
*
* @param percent {number}
* @returns percent {number} rounded
* @param percent {Number}
* @returns percent {Number} rounded
*/
calcWithStep: function (percent) {
var rounded = Math.round(percent / this.coords.p_step) * this.coords.p_step;
Expand Down
Loading

0 comments on commit 83f68c9

Please sign in to comment.