Change to eslint from jshint.

It's way better. Original files have been linted.
This commit is contained in:
Hyunje Alex Jun
2015-01-25 19:19:37 +00:00
parent 5d62b130e9
commit 95540bdd9e
8 changed files with 39 additions and 81 deletions

View File

@@ -3,13 +3,13 @@
*/
'use strict';
module.exports = (function() {
module.exports = (function () {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return function() {
return function () {
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
};

View File

@@ -14,5 +14,5 @@ module.exports = {
suppressScrollX: false,
suppressScrollY: false,
scrollXMarginOffset: 0,
scrollYMarginOffset: 0,
scrollYMarginOffset: 0
};

View File

@@ -3,8 +3,7 @@
*/
'use strict';
var cls = require('../lib/class')
, d = require('../lib/dom')
var d = require('../lib/dom')
, h = require('../lib/helper')
, instances = require('./instances');

View File

@@ -63,7 +63,7 @@ module.exports = function (element, userSettings) {
e.preventDefault();
};
var mouseUpHandler = function (e) {
var mouseUpHandler = function () {
cls.remove(element, 'ps-x');
cls.remove(element, 'ps-in-scrolling');
$(i.ownerDocument).unbind(i.eventClass('mousemove'), mouseMoveHandler);
@@ -97,7 +97,7 @@ module.exports = function (element, userSettings) {
e.preventDefault();
};
var mouseUpHandler = function (e) {
var mouseUpHandler = function () {
cls.remove(element, 'ps-y');
cls.remove(element, 'ps-in-scrolling');
$(i.ownerDocument).unbind(i.eventClass('mousemove'), mouseMoveHandler);
@@ -253,10 +253,10 @@ module.exports = function (element, userSettings) {
function bindKeyboardHandler() {
var hovered = false;
$(element).bind(i.eventClass('mouseenter'), function (e) {
$(element).bind(i.eventClass('mouseenter'), function () {
hovered = true;
});
$(element).bind(i.eventClass('mouseleave'), function (e) {
$(element).bind(i.eventClass('mouseleave'), function () {
hovered = false;
});
@@ -331,7 +331,7 @@ module.exports = function (element, userSettings) {
}
function bindRailClickHandler() {
function stopPropagation(e) { e.stopPropagation(); }
var stopPropagation = window.Event.prototype.stopPropagation.bind;
$(i.scrollbarY).bind(i.eventClass('click'), stopPropagation);
$(i.scrollbarYRail).bind(i.eventClass('click'), function (e) {
@@ -403,7 +403,7 @@ module.exports = function (element, userSettings) {
}
var isSelected = false;
$(i.ownerDocument).bind(i.eventClass('selectionchange'), function (e) {
$(i.ownerDocument).bind(i.eventClass('selectionchange'), function () {
if ($.contains(element, getRangeNode())) {
isSelected = true;
} else {
@@ -411,7 +411,7 @@ module.exports = function (element, userSettings) {
stopScrolling();
}
});
$(window).bind(i.eventClass('mouseup'), function (e) {
$(window).bind(i.eventClass('mouseup'), function () {
if (isSelected) {
isSelected = false;
stopScrolling();
@@ -480,10 +480,10 @@ module.exports = function (element, userSettings) {
var inGlobalTouch = false;
var inLocalTouch = false;
function globalTouchStart(e) {
function globalTouchStart() {
inGlobalTouch = true;
}
function globalTouchEnd(e) {
function globalTouchEnd() {
inGlobalTouch = false;
}
@@ -550,7 +550,7 @@ module.exports = function (element, userSettings) {
}
}
}
function touchEnd(e) {
function touchEnd() {
if (!inGlobalTouch && inLocalTouch) {
inLocalTouch = false;
@@ -600,7 +600,7 @@ module.exports = function (element, userSettings) {
}
function bindScrollHandler() {
$(element).bind(i.eventClass('scroll'), function (e) {
$(element).bind(i.eventClass('scroll'), function () {
updateGeometry(element);
});
}