Skip to content

Commit

Permalink
Update to 1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
IonDen committed Oct 10, 2013
1 parent 0f34830 commit 3311910
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 51 deletions.
Binary file modified PSD/sprite-skin.psd
Binary file not shown.
12 changes: 6 additions & 6 deletions css/ion.rangeSlider.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Ion.RangeSlider
// css version 1.5.42
// css version 1.8.1
// by Denis Ineshin | ionden.com
// ===================================================================================================================*/

Expand Down Expand Up @@ -41,17 +41,17 @@
}
.irs-slider.single:before {
position: absolute; display: block; content: "";
top: -50%; left: -150%;
width: 400%; height: 200%;
top: -50%; left: -100%;
width: 300%; height: 200%;
background: rgba(0,0,0,0.0);
}
.irs-slider.from {
left: 100px;
}
.irs-slider.from:before {
position: absolute; display: block; content: "";
top: -50%; left: -300%;
width: 400%; height: 200%;
top: -50%; left: -200%;
width: 300%; height: 200%;
background: rgba(0,0,0,0.0);
}
.irs-slider.to {
Expand All @@ -60,7 +60,7 @@
.irs-slider.to:before {
position: absolute; display: block; content: "";
top: -50%; left: 0;
width: 400%; height: 200%;
width: 300%; height: 200%;
background: rgba(0,0,0,0.0);
}
.irs-slider.last {
Expand Down
86 changes: 86 additions & 0 deletions css/ion.rangeSlider.skinFlat.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/* Ion.RangeSlider, Flat UI Skin
// css version 1.8.1
// by Denis Ineshin | ionden.com
// ===================================================================================================================*/

/* =====================================================================================================================
// Skin details */

.irs-line-mid,
.irs-line-left,
.irs-line-right,
.irs-diapason,
.irs-slider {
background: url(../img/sprite-skin-flat.png) repeat-x;
}

.irs {
height: 40px;
}
.irs-with-grid {
height: 60px;
}
.irs-line {
height: 12px; top: 25px;
}
.irs-line-left {
height: 12px;
background-position: 0 -30px;
}
.irs-line-mid {
height: 12px;
background-position: 0 0;
}
.irs-line-right {
height: 12px;
background-position: 100% -30px;
}

.irs-diapason {
height: 12px; top: 25px;
background-position: 0 -60px;
}

.irs-slider {
width: 16px; height: 18px;
top: 22px;
background-position: 0 -90px;
}
#irs-active-slider, .irs-slider:hover {
background-position: 0 -120px;
}

.irs-min, .irs-max {
color: #999;
font-size: 10px; line-height: 1.333;
text-shadow: none;
top: 0; padding: 1px 3px;
background: #e1e4e9;
border-radius: 4px;
}

.irs-from, .irs-to, .irs-single {
color: #fff;
font-size: 10px; line-height: 1.333;
text-shadow: none;
padding: 1px 5px;
background: #ed5565;
border-radius: 4px;
}
.irs-from:after, .irs-to:after, .irs-single:after {
position: absolute; display: block; content: "";
bottom: -6px; left: 50%;
width: 0; height: 0;
margin-left: -3px;
overflow: hidden;
border: 3px solid transparent;
border-top-color: #ed5565;
}


.irs-grid-pol {
background: #e1e4e9;
}
.irs-grid-text {
color: #999;
}
2 changes: 1 addition & 1 deletion css/ion.rangeSlider.skinNice.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Ion.RangeSlider, Nice Skin
// css version 1.5.11
// css version 1.7.0
// by Denis Ineshin | ionden.com
// ===================================================================================================================*/

Expand Down
2 changes: 1 addition & 1 deletion css/ion.rangeSlider.skinSimple.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Ion.RangeSlider, Simple Skin
// css version 1.5.11
// css version 1.7.0
// by Denis Ineshin | ionden.com
// ===================================================================================================================*/

Expand Down
Binary file added img/sprite-skin-flat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/sprite-skin-nice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/sprite-skin-simple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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": "1.8.0",
"version": "1.8.1",
"title": "Ion.RangeSlider",
"description": "Cool, comfortable and easily customizable range slider with many options and skin support",
"keywords": [
Expand Down Expand Up @@ -29,7 +29,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-1.8.0.zip",
"download": "http://ionden.com/a/plugins/ion.rangeSlider/ion.rangeSlider-1.8.1.zip",
"dependencies": {
"jquery": ">=1.9"
}
Expand Down
52 changes: 33 additions & 19 deletions js/ion.rangeSlider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ion.RangeSlider
// version 1.8.0 Build: 142
// version 1.8.1 Build: 144
// © 2013 Denis Ineshin | IonDen.com
//
// Project page: http://ionden.com/a/plugins/ion.rangeSlider/
Expand Down Expand Up @@ -445,41 +445,45 @@

var setDiapason = function () {
var _w = $fromSlider.width(),
_x = parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left,
_width = parseInt($toSlider[0].style.left, 10) || $toSlider.position().left,
_x = $.data($fromSlider[0], "x") || parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left,
_width = $.data($toSlider[0], "x") || parseInt($toSlider[0].style.left, 10) || $toSlider.position().left,
x = _x + (_w / 2),
w = _width - _x;
$diapason[0].style.left = x + "px";
$diapason[0].style.width = w + "px";
};

var dragSlider = function () {
var x = Math.round(mouseX - minusX);
var x_pure = mouseX - minusX,
x;

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

if (x < 0) {
x = 0;
if (x_pure < 0) {
x_pure = 0;
}
if (x > width) {
x = width;
if (x_pure > width) {
x_pure = width;
}
getNumbers();

} else if (settings.type === "double") {

if (x < left) {
x = left;
if (x_pure < left) {
x_pure = left;
}
if (x > right) {
x = right;
if (x_pure > right) {
x_pure = right;
}
getNumbers();
setDiapason();

}

x = Math.round(x_pure);

$activeSlider[0].style.left = x + "px";
$.data($activeSlider[0], "x", x_pure);
};

var getNumbers = function () {
Expand All @@ -495,7 +499,7 @@

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

nums.fromX = parseInt($singleSlider[0].style.left, 10) || $singleSlider.position().left;
nums.fromX = $.data($singleSlider[0], "x") || parseInt($singleSlider[0].style.left, 10) || $singleSlider.position().left;
nums.fromPers = nums.fromX / fullWidth * 100;
_from = (diapason / 100 * nums.fromPers) + parseInt(settings.min, 10);
nums.fromNumber = Math.round(_from / settings.step) * settings.step;
Expand All @@ -506,12 +510,12 @@

} else if (settings.type === "double") {

nums.fromX = parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left;
nums.fromX = $.data($fromSlider[0], "x") || parseInt($fromSlider[0].style.left, 10) || $fromSlider.position().left;
nums.fromPers = nums.fromX / fullWidth * 100;
_from = (diapason / 100 * nums.fromPers) + parseInt(settings.min, 10);
nums.fromNumber = Math.round(_from / settings.step) * settings.step;

nums.toX = parseInt($toSlider[0].style.left, 10) || $toSlider.position().left;
nums.toX = $.data($toSlider[0], "x") || parseInt($toSlider[0].style.left, 10) || $toSlider.position().left;
nums.toPers = nums.toX / fullWidth * 100;
_to = (diapason / 100 * nums.toPers) + parseInt(settings.min, 10);
nums.toNumber = Math.round(_to / settings.step) * settings.step;
Expand All @@ -535,24 +539,34 @@
fromPers: 0,
toPers: 0,
fromX: 0,
toX: 0
fromX_pure: 0,
toX: 0,
toX_pure: 0
};
var diapason = settings.max - settings.min;

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

nums.fromPers = (nums.fromNumber - settings.min) / diapason * 100;
nums.fromX = Math.round(fullWidth / 100 * nums.fromPers);
nums.fromX_pure = fullWidth / 100 * nums.fromPers;
nums.fromX = Math.round(nums.fromX_pure);
$singleSlider[0].style.left = nums.fromX + "px";
$.data($singleSlider[0], "x", nums.fromX_pure);

} else if (settings.type === "double") {

nums.fromPers = (nums.fromNumber - settings.min) / diapason * 100;
nums.fromX = Math.round(fullWidth / 100 * nums.fromPers);
nums.fromX_pure = fullWidth / 100 * nums.fromPers;
nums.fromX = Math.round(nums.fromX_pure);
$fromSlider[0].style.left = nums.fromX + "px";
$.data($fromSlider[0], "x", nums.fromX_pure);

nums.toPers = (nums.toNumber - settings.min) / diapason * 100;
nums.toX = Math.round(fullWidth / 100 * nums.toPers);
nums.toX_pure = fullWidth / 100 * nums.toPers;
nums.toX = Math.round(nums.toX_pure);
$toSlider[0].style.left = nums.toX + "px";
$.data($toSlider[0], "x", nums.toX_pure);

setDiapason();

}
Expand Down
Loading

0 comments on commit 3311910

Please sign in to comment.