Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #173 from andreruffert/release/v2.0.2
Browse files Browse the repository at this point in the history
Release: v2.0.2
  • Loading branch information
andreruffert committed Sep 10, 2015
2 parents 64b8744 + 79e0727 commit 2b355ff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 44 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rangeslider.js",
"version": "2.0.1",
"version": "2.0.2",
"homepage": "https://github.com/andreruffert/rangeslider.js",
"authors": [
"André Ruffert <[email protected]>"
Expand Down
24 changes: 4 additions & 20 deletions dist/rangeslider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! rangeslider.js - v2.0.1 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
/*! rangeslider.js - v2.0.2 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
(function(factory) {
'use strict';

Expand Down Expand Up @@ -205,22 +205,6 @@
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
* Get cross-browser scroll position.
* https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX
*
* @param {String} coordinate x|y
* @param {String} direction top|left
* @return {Number}
*/
function getScrollOffset(coordinate, direction) {
coordinate = ucfirst(coordinate);
if (window['page' + coordinate + 'Offset'] !== undefined) {
return window['page' + coordinate + 'Offset'];
}
return (document.documentElement || document.body.parentNode || document.body)['scroll' + ucfirst(direction)];
}

/**
* Plugin
* @param {String} element
Expand Down Expand Up @@ -415,13 +399,13 @@
};

Plugin.prototype.getRelativePosition = function(e) {
// Get the offset DIRECTION relative to the viewport and scroll position
// Get the offset DIRECTION relative to the viewport
var ucCoordinate = ucfirst(this.COORDINATE),
rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION] + getScrollOffset(this.COORDINATE, this.DIRECTION),
rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION],
pageCoordinate = 0;

if (typeof e['page' + ucCoordinate] !== 'undefined') {
pageCoordinate = e['page' + ucCoordinate];
pageCoordinate = e['client' + ucCoordinate];
}
else if (typeof e.originalEvent['client' + ucCoordinate] !== 'undefined') {
pageCoordinate = e.originalEvent['client' + ucCoordinate];
Expand Down
4 changes: 2 additions & 2 deletions dist/rangeslider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "rangeslider.js",
"title": "rangeslider.js",
"description": "Simple, small and fast JavaScript/jQuery polyfill for the HTML5 <input type=\"range\"> slider element",
"version": "2.0.1",
"codename": "Lemon Yellow",
"version": "2.0.2",
"codename": "Jungle Green",
"main": "dist/rangeslider.js",
"homepage": "https://github.com/andreruffert/rangeslider.js",
"author": {
Expand Down
22 changes: 3 additions & 19 deletions src/rangeslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,6 @@
return str.charAt(0).toUpperCase() + str.substr(1);
}

/**
* Get cross-browser scroll position.
* https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX
*
* @param {String} coordinate x|y
* @param {String} direction top|left
* @return {Number}
*/
function getScrollOffset(coordinate, direction) {
coordinate = ucfirst(coordinate);
if (window['page' + coordinate + 'Offset'] !== undefined) {
return window['page' + coordinate + 'Offset'];
}
return (document.documentElement || document.body.parentNode || document.body)['scroll' + ucfirst(direction)];
}

/**
* Plugin
* @param {String} element
Expand Down Expand Up @@ -414,13 +398,13 @@
};

Plugin.prototype.getRelativePosition = function(e) {
// Get the offset DIRECTION relative to the viewport and scroll position
// Get the offset DIRECTION relative to the viewport
var ucCoordinate = ucfirst(this.COORDINATE),
rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION] + getScrollOffset(this.COORDINATE, this.DIRECTION),
rangePos = this.$range[0].getBoundingClientRect()[this.DIRECTION],
pageCoordinate = 0;

if (typeof e['page' + ucCoordinate] !== 'undefined') {
pageCoordinate = e['page' + ucCoordinate];
pageCoordinate = e['client' + ucCoordinate];
}
else if (typeof e.originalEvent['client' + ucCoordinate] !== 'undefined') {
pageCoordinate = e.originalEvent['client' + ucCoordinate];
Expand Down

0 comments on commit 2b355ff

Please sign in to comment.