From a2b2a77de18446260ca4f377e5e3090dd4feeb4c Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Mon, 22 Feb 2016 22:45:32 +0900 Subject: [PATCH] Change variable definition style Use 'var' everytime, instead of using ','. --- examples/events.html | 10 ++++----- gulpfile.js | 30 ++++++++++++------------- src/js/adaptor/jquery.js | 4 ++-- src/js/lib/helper.js | 4 ++-- src/js/main.js | 6 ++--- src/js/plugin/destroy.js | 6 ++--- src/js/plugin/handler/click-rail.js | 8 +++---- src/js/plugin/handler/drag-scrollbar.js | 10 ++++----- src/js/plugin/handler/keyboard.js | 10 ++++----- src/js/plugin/handler/mouse-wheel.js | 6 ++--- src/js/plugin/handler/native-scroll.js | 4 ++-- src/js/plugin/handler/selection.js | 8 +++---- src/js/plugin/handler/touch.js | 8 +++---- src/js/plugin/initialize.js | 8 +++---- src/js/plugin/instances.js | 12 +++++----- src/js/plugin/update-geometry.js | 10 ++++----- src/js/plugin/update-scroll.js | 24 ++++++++++---------- src/js/plugin/update.js | 10 ++++----- 18 files changed, 89 insertions(+), 89 deletions(-) diff --git a/examples/events.html b/examples/events.html index 3f8806f..f3c3f11 100644 --- a/examples/events.html +++ b/examples/events.html @@ -38,10 +38,11 @@

Start / End (scroll to the start or end of an axis)

diff --git a/gulpfile.js b/gulpfile.js index d05cb3c..2512b2f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,20 +1,20 @@ 'use strict'; -var gulp = require('gulp') - , browserify = require('browserify') - , buffer = require('vinyl-buffer') - , connect = require('gulp-connect') - , del = require('del') - , eslint = require('gulp-eslint') - , insert = require('gulp-insert') - , path = require('path') - , rename = require('gulp-rename') - , sass = require('gulp-sass') - , source = require('vinyl-source-stream') - , stream = require('event-stream') - , uglify = require('gulp-uglify') - , autoprefixer = require('gulp-autoprefixer') - , zip = require('gulp-zip'); +var autoprefixer = require('gulp-autoprefixer'); +var browserify = require('browserify'); +var buffer = require('vinyl-buffer'); +var connect = require('gulp-connect'); +var del = require('del'); +var eslint = require('gulp-eslint'); +var gulp = require('gulp'); +var insert = require('gulp-insert'); +var path = require('path'); +var rename = require('gulp-rename'); +var sass = require('gulp-sass'); +var source = require('vinyl-source-stream'); +var stream = require('event-stream'); +var uglify = require('gulp-uglify'); +var zip = require('gulp-zip'); var version = '/* perfect-scrollbar v' + require('./package').version + ' */\n'; diff --git a/src/js/adaptor/jquery.js b/src/js/adaptor/jquery.js index 673b428..f9840fa 100644 --- a/src/js/adaptor/jquery.js +++ b/src/js/adaptor/jquery.js @@ -1,7 +1,7 @@ 'use strict'; -var ps = require('../main') - , psInstances = require('../plugin/instances'); +var ps = require('../main'); +var psInstances = require('../plugin/instances'); function mountJQuery(jQuery) { jQuery.fn.perfectScrollbar = function (settingOrCommand) { diff --git a/src/js/lib/helper.js b/src/js/lib/helper.js index 69e0c10..b30fb08 100644 --- a/src/js/lib/helper.js +++ b/src/js/lib/helper.js @@ -1,7 +1,7 @@ 'use strict'; -var cls = require('./class') - , dom = require('./dom'); +var cls = require('./class'); +var dom = require('./dom'); var toInt = exports.toInt = function (x) { return parseInt(x, 10) || 0; diff --git a/src/js/main.js b/src/js/main.js index e7159bc..06b1c2b 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,8 +1,8 @@ 'use strict'; -var destroy = require('./plugin/destroy') - , initialize = require('./plugin/initialize') - , update = require('./plugin/update'); +var destroy = require('./plugin/destroy'); +var initialize = require('./plugin/initialize'); +var update = require('./plugin/update'); module.exports = { initialize: initialize, diff --git a/src/js/plugin/destroy.js b/src/js/plugin/destroy.js index 9c03d06..97a83e0 100644 --- a/src/js/plugin/destroy.js +++ b/src/js/plugin/destroy.js @@ -1,8 +1,8 @@ 'use strict'; -var dom = require('../lib/dom') - , _ = require('../lib/helper') - , instances = require('./instances'); +var _ = require('../lib/helper'); +var dom = require('../lib/dom'); +var instances = require('./instances'); module.exports = function (element) { var i = instances.get(element); diff --git a/src/js/plugin/handler/click-rail.js b/src/js/plugin/handler/click-rail.js index 9c14a52..f78da5c 100644 --- a/src/js/plugin/handler/click-rail.js +++ b/src/js/plugin/handler/click-rail.js @@ -1,9 +1,9 @@ 'use strict'; -var _ = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); +var _ = require('../../lib/helper'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); +var updateScroll = require('../update-scroll'); function bindClickRailHandler(element, i) { function pageOffset(el) { diff --git a/src/js/plugin/handler/drag-scrollbar.js b/src/js/plugin/handler/drag-scrollbar.js index 57acfda..fc99d00 100644 --- a/src/js/plugin/handler/drag-scrollbar.js +++ b/src/js/plugin/handler/drag-scrollbar.js @@ -1,10 +1,10 @@ 'use strict'; -var dom = require('../../lib/dom') - , _ = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); +var _ = require('../../lib/helper'); +var dom = require('../../lib/dom'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); +var updateScroll = require('../update-scroll'); function bindMouseScrollXHandler(element, i) { var currentLeft = null; diff --git a/src/js/plugin/handler/keyboard.js b/src/js/plugin/handler/keyboard.js index 3632e86..07acfb3 100644 --- a/src/js/plugin/handler/keyboard.js +++ b/src/js/plugin/handler/keyboard.js @@ -1,10 +1,10 @@ 'use strict'; -var _ = require('../../lib/helper') - , dom = require('../../lib/dom') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); +var _ = require('../../lib/helper'); +var dom = require('../../lib/dom'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); +var updateScroll = require('../update-scroll'); function bindKeyboardHandler(element, i) { var hovered = false; diff --git a/src/js/plugin/handler/mouse-wheel.js b/src/js/plugin/handler/mouse-wheel.js index 6a1a9fd..587737c 100644 --- a/src/js/plugin/handler/mouse-wheel.js +++ b/src/js/plugin/handler/mouse-wheel.js @@ -1,8 +1,8 @@ 'use strict'; -var instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); +var updateScroll = require('../update-scroll'); function bindMouseWheelHandler(element, i) { var shouldPrevent = false; diff --git a/src/js/plugin/handler/native-scroll.js b/src/js/plugin/handler/native-scroll.js index 4f87ead..8664b23 100644 --- a/src/js/plugin/handler/native-scroll.js +++ b/src/js/plugin/handler/native-scroll.js @@ -1,7 +1,7 @@ 'use strict'; -var instances = require('../instances') - , updateGeometry = require('../update-geometry'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); function bindNativeScrollHandler(element, i) { i.event.bind(element, 'scroll', function () { diff --git a/src/js/plugin/handler/selection.js b/src/js/plugin/handler/selection.js index 288fe51..297b2c9 100644 --- a/src/js/plugin/handler/selection.js +++ b/src/js/plugin/handler/selection.js @@ -1,9 +1,9 @@ 'use strict'; -var _ = require('../../lib/helper') - , instances = require('../instances') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); +var _ = require('../../lib/helper'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); +var updateScroll = require('../update-scroll'); function bindSelectionHandler(element, i) { function getRangeNode() { diff --git a/src/js/plugin/handler/touch.js b/src/js/plugin/handler/touch.js index 4f0e9ea..498afc3 100644 --- a/src/js/plugin/handler/touch.js +++ b/src/js/plugin/handler/touch.js @@ -1,9 +1,9 @@ 'use strict'; -var instances = require('../instances') - , _ = require('../../lib/helper') - , updateGeometry = require('../update-geometry') - , updateScroll = require('../update-scroll'); +var _ = require('../../lib/helper'); +var instances = require('../instances'); +var updateGeometry = require('../update-geometry'); +var updateScroll = require('../update-scroll'); function bindTouchHandler(element, i, supportsTouch, supportsIePointer) { function shouldPreventDefault(deltaX, deltaY) { diff --git a/src/js/plugin/initialize.js b/src/js/plugin/initialize.js index 12f1e3e..05918a5 100644 --- a/src/js/plugin/initialize.js +++ b/src/js/plugin/initialize.js @@ -1,9 +1,9 @@ 'use strict'; -var cls = require('../lib/class') - , _ = require('../lib/helper') - , instances = require('./instances') - , updateGeometry = require('./update-geometry'); +var _ = require('../lib/helper'); +var cls = require('../lib/class'); +var instances = require('./instances'); +var updateGeometry = require('./update-geometry'); // Handlers var handlers = { diff --git a/src/js/plugin/instances.js b/src/js/plugin/instances.js index 0448929..9c233c0 100644 --- a/src/js/plugin/instances.js +++ b/src/js/plugin/instances.js @@ -1,11 +1,11 @@ 'use strict'; -var cls = require('../lib/class') - , dom = require('../lib/dom') - , defaultSettings = require('./default-setting') - , EventManager = require('../lib/event-manager') - , guid = require('../lib/guid') - , _ = require('../lib/helper'); +var _ = require('../lib/helper'); +var cls = require('../lib/class'); +var defaultSettings = require('./default-setting'); +var dom = require('../lib/dom'); +var EventManager = require('../lib/event-manager'); +var guid = require('../lib/guid'); var instances = {}; diff --git a/src/js/plugin/update-geometry.js b/src/js/plugin/update-geometry.js index 97fa742..b936ea1 100644 --- a/src/js/plugin/update-geometry.js +++ b/src/js/plugin/update-geometry.js @@ -1,10 +1,10 @@ 'use strict'; -var cls = require('../lib/class') - , dom = require('../lib/dom') - , _ = require('../lib/helper') - , instances = require('./instances') - , updateScroll = require('./update-scroll'); +var _ = require('../lib/helper'); +var cls = require('../lib/class'); +var dom = require('../lib/dom'); +var instances = require('./instances'); +var updateScroll = require('./update-scroll'); function getThumbSize(i, thumbSize) { if (i.settings.minScrollbarLength) { diff --git a/src/js/plugin/update-scroll.js b/src/js/plugin/update-scroll.js index b308465..40863c7 100644 --- a/src/js/plugin/update-scroll.js +++ b/src/js/plugin/update-scroll.js @@ -2,18 +2,18 @@ var instances = require('./instances'); -var upEvent = document.createEvent('Event') - , downEvent = document.createEvent('Event') - , leftEvent = document.createEvent('Event') - , rightEvent = document.createEvent('Event') - , yEvent = document.createEvent('Event') - , xEvent = document.createEvent('Event') - , xStartEvent = document.createEvent('Event') - , xEndEvent = document.createEvent('Event') - , yStartEvent = document.createEvent('Event') - , yEndEvent = document.createEvent('Event') - , lastTop - , lastLeft; +var upEvent = document.createEvent('Event'); +var downEvent = document.createEvent('Event'); +var leftEvent = document.createEvent('Event'); +var rightEvent = document.createEvent('Event'); +var yEvent = document.createEvent('Event'); +var xEvent = document.createEvent('Event'); +var xStartEvent = document.createEvent('Event'); +var xEndEvent = document.createEvent('Event'); +var yStartEvent = document.createEvent('Event'); +var yEndEvent = document.createEvent('Event'); +var lastTop; +var lastLeft; upEvent.initEvent('ps-scroll-up', true, true); downEvent.initEvent('ps-scroll-down', true, true); diff --git a/src/js/plugin/update.js b/src/js/plugin/update.js index bba7573..cc9da15 100644 --- a/src/js/plugin/update.js +++ b/src/js/plugin/update.js @@ -1,10 +1,10 @@ 'use strict'; -var dom = require('../lib/dom') - , _ = require('../lib/helper') - , instances = require('./instances') - , updateGeometry = require('./update-geometry') - , updateScroll = require('./update-scroll'); +var _ = require('../lib/helper'); +var dom = require('../lib/dom'); +var instances = require('./instances'); +var updateGeometry = require('./update-geometry'); +var updateScroll = require('./update-scroll'); module.exports = function (element) { var i = instances.get(element);