Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 2f80547

Browse files
committed
Merge pull request #62 from andreruffert/develop
Release v0.2.9
2 parents 88c82ba + 46df593 commit 2f80547

9 files changed

+154
-92
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#rangeslider.js [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
1+
#rangeslider.js [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) [![rangeslider.js](http://img.shields.io/badge/rangeslider-.js-00ff00.svg)](http://andreruffert.github.io/rangeslider.js/)
22
Simple, small and fast JavaScript/jQuery polyfill for the HTML5 `<input type="range">` slider element.
33
Check out the [demo](http://andreruffert.github.io/rangeslider.js/).
44

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rangeslider.js",
3-
"version": "0.2.8",
3+
"version": "0.2.9",
44
"main": "dist/rangeslider.js",
55
"homepage": "https://github.com/andreruffert/rangeslider.js",
66
"author": "André Ruffert",

dist/rangeslider.css

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.rangeslider,
22
.rangeslider__fill {
33
background: #e6e6e6;
4-
border: none;
54
display: block;
65
height: 20px;
76
width: 100%;
@@ -39,14 +38,14 @@
3938
background-image: -moz-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
4039
background-image: -o-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
4140
background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
42-
-webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
43-
-moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
44-
box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
45-
-webkit-border-radius: 20px;
46-
-moz-border-radius: 20px;
47-
-ms-border-radius: 20px;
48-
-o-border-radius: 20px;
49-
border-radius: 20px;
41+
-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
42+
-moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
43+
box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
44+
-webkit-border-radius: 50%;
45+
-moz-border-radius: 50%;
46+
-ms-border-radius: 50%;
47+
-o-border-radius: 50%;
48+
border-radius: 50%;
5049
}
5150
.rangeslider__handle:after {
5251
content: "";
@@ -64,9 +63,22 @@
6463
background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
6564
background-image: -o-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
6665
background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
67-
-webkit-border-radius: 20px;
68-
-moz-border-radius: 20px;
69-
-ms-border-radius: 20px;
70-
-o-border-radius: 20px;
71-
border-radius: 20px;
66+
-webkit-border-radius: 50%;
67+
-moz-border-radius: 50%;
68+
-ms-border-radius: 50%;
69+
-o-border-radius: 50%;
70+
border-radius: 50%;
71+
}
72+
.rangeslider__handle:active {
73+
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, rgba(0, 0, 0, 0.12)));
74+
background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
75+
background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
76+
background-image: -o-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
77+
background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
78+
}
79+
80+
input[type="range"]:focus + .rangeslider .rangeslider__handle {
81+
-webkit-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
82+
-moz-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
83+
box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
7284
}

dist/rangeslider.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
/*! rangeslider.js - v0.2.8 | (c) 2014 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
22
'use strict';
33

4-
(function (module) {
4+
(function(factory) {
55
if (typeof define === 'function' && define.amd) {
66
// AMD. Register as an anonymous module.
7-
define(['jquery'], module);
7+
define(['jquery'], factory);
8+
}
9+
else if (typeof exports === 'object') {
10+
// CommonJS
11+
factory(require('jquery'));
812
} else {
913
// Browser globals
10-
module(jQuery);
14+
factory(jQuery);
1115
}
12-
})(function($, undefined) {
16+
}(function($) {
1317

1418
/**
1519
* Range feature detection
@@ -98,21 +102,21 @@
98102
}
99103

100104
this.identifier = 'js-' + pluginName + '-' +(+new Date());
101-
this.min = parseFloat(this.$element[0].getAttribute('min')) || 0;
102-
this.max = parseFloat(this.$element[0].getAttribute('max')) || 100;
103-
this.value = parseFloat(this.$element[0].value) || this.min + (this.max-this.min)/2;
104-
this.step = parseFloat(this.$element[0].getAttribute('step')) || 1;
105+
this.min = parseFloat(this.$element[0].getAttribute('min') || 0);
106+
this.max = parseFloat(this.$element[0].getAttribute('max') || 100);
107+
this.value = parseFloat(this.$element[0].value || this.min + (this.max-this.min)/2);
108+
this.step = parseFloat(this.$element[0].getAttribute('step') || 1);
105109
this.$fill = $('<div class="' + this.options.fillClass + '" />');
106110
this.$handle = $('<div class="' + this.options.handleClass + '" />');
107-
this.$range = $('<div class="' + this.options.rangeClass + '" id="' + this.identifier + '" />').insertBefore(this.$element).prepend(this.$fill, this.$handle);
111+
this.$range = $('<div class="' + this.options.rangeClass + '" id="' + this.identifier + '" />').insertAfter(this.$element).prepend(this.$fill, this.$handle);
108112

109113
// visually hide the input
110114
this.$element.css({
111115
'position': 'absolute',
112116
'width': '1px',
113117
'height': '1px',
114118
'overflow': 'hidden',
115-
'visibility': 'hidden'
119+
'opacity': '0'
116120
});
117121

118122
// Store context
@@ -247,7 +251,7 @@
247251

248252
Plugin.prototype.getValueFromPosition = function(pos) {
249253
var percentage, value;
250-
percentage = (pos) / (this.maxHandleX);
254+
percentage = ((pos) / (this.maxHandleX || 1));
251255
value = this.step * Math.ceil((((percentage) * (this.max - this.min)) + this.min) / this.step);
252256
return Number((value).toFixed(2));
253257
};
@@ -296,4 +300,4 @@
296300
});
297301
};
298302

299-
});
303+
}));

dist/rangeslider.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)