Skip to content

Commit

Permalink
Update to 2.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
IonDen committed Jul 10, 2015
1 parent 96e1262 commit d7ec451
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 115 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.11",
"version": "2.0.12",
"homepage": "https://github.com/IonDen/ion.rangeSlider",
"authors": [
{
Expand Down
4 changes: 2 additions & 2 deletions designer.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Designer wanted
# Looking for designer

Hi friends. I need a designer to create logos for all series of plugins: Ion.RangeSlider, Ion.Sound etc.
For free. In exchange i will put your name and link to your web site in to description of all products.
Expand All @@ -8,4 +8,4 @@ You can connect me via e-mail: [email protected]

Привет друзья. Очень нужен дизайнер нарисовать серию логотипов для всей линейки плагинов: Ion.RangeSlider, Ion.Sound и т.д.
Бесплатно. Взамен обещаю внести ваше имя и ссылку на ваш сайт в описание проектов.
Вы можете связаться со мной через e-mail: [email protected]
Вы можете связаться со мной через e-mail: [email protected]
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.12. July 10, 2015
* Fixed more bugs. Issues: #247, #263, #265, #269

### Version 2.0.11. July 02, 2015
* Fixed more bugs. Issues: #247, #253

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.11
# Ion.Range Slider 2.0.12

> English description | <a href="readme.ru.md">Описание на русском</a>
Easy, flexible and responsive 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.11.zip">Download ion.rangeSlider-2.0.11.zip</a>
* <a href="http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.12.zip">Download ion.rangeSlider-2.0.12.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.11",
"version": "2.0.12",
"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.11.zip",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-2.0.12.zip",
"dependencies": {
"jquery": ">=1.8"
}
Expand Down
79 changes: 40 additions & 39 deletions js/ion.rangeSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ion.RangeSlider
// version 2.0.11 Build: 327
// version 2.0.12 Build: 331
// © Denis Ineshin, 2015
// https://github.com/IonDen
//
Expand Down Expand Up @@ -138,7 +138,7 @@
// Core

var IonRangeSlider = function (input, options, plugin_count) {
this.VERSION = "2.0.11";
this.VERSION = "2.0.12";
this.input = input;
this.plugin_count = plugin_count;
this.current_plugin = 0;
Expand Down Expand Up @@ -175,6 +175,7 @@
shad_single: null,
shad_from: null,
shad_to: null,
edge: null,
grid: null,
grid_labels: []
};
Expand Down Expand Up @@ -437,6 +438,7 @@

if (this.options.type === "single") {
this.$cache.cont.append(single_html);
this.$cache.edge = this.$cache.cont.find(".irs-bar-edge");
this.$cache.s_single = this.$cache.cont.find(".single");
this.$cache.from[0].style.visibility = "hidden";
this.$cache.to[0].style.visibility = "hidden";
Expand Down Expand Up @@ -536,6 +538,7 @@
this.$cache.shad_single.on("touchstart.irs_" + this.plugin_count, this.pointerClick.bind(this, "click"));

this.$cache.s_single.on("mousedown.irs_" + this.plugin_count, this.pointerDown.bind(this, "single"));
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.s_from.on("touchstart.irs_" + this.plugin_count, this.pointerDown.bind(this, "from"));
Expand Down Expand Up @@ -600,24 +603,7 @@
this.updateScene();
},

pointerDown: function (target, e) {
e.preventDefault();
var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX;
if (e.button === 2) {
return;
}

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

this.is_active = true;
this.dragging = true;

this.coords.x_gap = this.$cache.rs.offset().left;
this.coords.x_pointer = x - this.coords.x_gap;

this.calcPointer();

changeLevel: function (target) {
switch (target) {
case "single":
this.coords.p_gap = this.toFixed(this.coords.p_pointer - this.coords.p_single);
Expand All @@ -641,6 +627,26 @@
this.$cache.s_from.removeClass("type_last");
break;
}
},

pointerDown: function (target, e) {
e.preventDefault();
var x = e.pageX || e.originalEvent.touches && e.originalEvent.touches[0].pageX;
if (e.button === 2) {
return;
}

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

this.is_active = true;
this.dragging = true;

this.coords.x_gap = this.$cache.rs.offset().left;
this.coords.x_pointer = x - this.coords.x_gap;

this.calcPointer();
this.changeLevel(target);

if (is_old_ie) {
$("*").prop("unselectable", true);
Expand Down Expand Up @@ -769,7 +775,8 @@
real_x = this.toFixed(this.coords.p_pointer - this.coords.p_gap);

if (this.target === "click") {
real_x = this.toFixed(this.coords.p_pointer - (this.coords.p_handle / 2));
this.coords.p_gap = this.coords.p_handle / 2;
real_x = this.toFixed(this.coords.p_pointer - this.coords.p_gap);
this.target = this.chooseHandle(real_x);
}

Expand Down Expand Up @@ -1294,6 +1301,14 @@
avg_decimals = 0,
abs = 0;

if (percent === 0) {
return this.options.min;
}
if (percent === 100) {
return this.options.max;
}


if (min_decimals) {
min_length = min_decimals.length;
avg_decimals = min_length;
Expand All @@ -1317,34 +1332,20 @@
result;

if (string) {
if (number !== min && number !== max) {
number = +number.toFixed(string.length);
} else {
number = +number.toFixed(avg_decimals);
}
number = +number.toFixed(string.length);
} else {
number = number / this.options.step;
number = number * this.options.step;

if (number !== min && number !== max) {
number = +number.toFixed(0);
} else {
number = +number.toFixed(avg_decimals);
}
number = +number.toFixed(0);
}

if (abs) {
number -= abs;
min = this.options.min;
max = this.options.max;
}

if (string) {
if (number !== min && number !== max) {
result = +number.toFixed(string.length);
} else {
result = +number.toFixed(avg_decimals);
}
result = +number.toFixed(string.length);
} else {
result = this.toFixed(number);
}
Expand Down Expand Up @@ -1453,7 +1454,7 @@
},

toFixed: function (num) {
num = num.toFixed(5);
num = num.toFixed(9);
return +num;
},

Expand Down
Loading

0 comments on commit d7ec451

Please sign in to comment.