Change variable definition style
Use 'var' everytime, instead of using ','.
This commit is contained in:
parent
e63d4c03cb
commit
a2b2a77de1
@ -38,10 +38,11 @@
|
|||||||
|
|
||||||
<p><strong>Start / End</strong> <span id="start-end">(scroll to the start or end of an axis)</span></p>
|
<p><strong>Start / End</strong> <span id="start-end">(scroll to the start or end of an axis)</span></p>
|
||||||
<script>
|
<script>
|
||||||
var container = document.querySelector('.container')
|
var container = document.querySelector('.container');
|
||||||
, axis = document.getElementById('axis')
|
var axis = document.getElementById('axis');
|
||||||
, direction = document.getElementById('direction')
|
var direction = document.getElementById('direction');
|
||||||
, startEnd = document.getElementById('start-end');
|
var startEnd = document.getElementById('start-end');
|
||||||
|
|
||||||
Ps.initialize(container);
|
Ps.initialize(container);
|
||||||
|
|
||||||
document.addEventListener('ps-scroll-y', function () {
|
document.addEventListener('ps-scroll-y', function () {
|
||||||
@ -83,7 +84,6 @@
|
|||||||
document.addEventListener('ps-x-reach-end', function () {
|
document.addEventListener('ps-x-reach-end', function () {
|
||||||
startEnd.innerHTML = 'Reached end of <em>X-Axis</em>'
|
startEnd.innerHTML = 'Reached end of <em>X-Axis</em>'
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
30
gulpfile.js
30
gulpfile.js
@ -1,20 +1,20 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var gulp = require('gulp')
|
var autoprefixer = require('gulp-autoprefixer');
|
||||||
, browserify = require('browserify')
|
var browserify = require('browserify');
|
||||||
, buffer = require('vinyl-buffer')
|
var buffer = require('vinyl-buffer');
|
||||||
, connect = require('gulp-connect')
|
var connect = require('gulp-connect');
|
||||||
, del = require('del')
|
var del = require('del');
|
||||||
, eslint = require('gulp-eslint')
|
var eslint = require('gulp-eslint');
|
||||||
, insert = require('gulp-insert')
|
var gulp = require('gulp');
|
||||||
, path = require('path')
|
var insert = require('gulp-insert');
|
||||||
, rename = require('gulp-rename')
|
var path = require('path');
|
||||||
, sass = require('gulp-sass')
|
var rename = require('gulp-rename');
|
||||||
, source = require('vinyl-source-stream')
|
var sass = require('gulp-sass');
|
||||||
, stream = require('event-stream')
|
var source = require('vinyl-source-stream');
|
||||||
, uglify = require('gulp-uglify')
|
var stream = require('event-stream');
|
||||||
, autoprefixer = require('gulp-autoprefixer')
|
var uglify = require('gulp-uglify');
|
||||||
, zip = require('gulp-zip');
|
var zip = require('gulp-zip');
|
||||||
|
|
||||||
var version = '/* perfect-scrollbar v' + require('./package').version + ' */\n';
|
var version = '/* perfect-scrollbar v' + require('./package').version + ' */\n';
|
||||||
|
|
||||||
|
4
src/js/adaptor/jquery.js
vendored
4
src/js/adaptor/jquery.js
vendored
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ps = require('../main')
|
var ps = require('../main');
|
||||||
, psInstances = require('../plugin/instances');
|
var psInstances = require('../plugin/instances');
|
||||||
|
|
||||||
function mountJQuery(jQuery) {
|
function mountJQuery(jQuery) {
|
||||||
jQuery.fn.perfectScrollbar = function (settingOrCommand) {
|
jQuery.fn.perfectScrollbar = function (settingOrCommand) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var cls = require('./class')
|
var cls = require('./class');
|
||||||
, dom = require('./dom');
|
var dom = require('./dom');
|
||||||
|
|
||||||
var toInt = exports.toInt = function (x) {
|
var toInt = exports.toInt = function (x) {
|
||||||
return parseInt(x, 10) || 0;
|
return parseInt(x, 10) || 0;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var destroy = require('./plugin/destroy')
|
var destroy = require('./plugin/destroy');
|
||||||
, initialize = require('./plugin/initialize')
|
var initialize = require('./plugin/initialize');
|
||||||
, update = require('./plugin/update');
|
var update = require('./plugin/update');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
initialize: initialize,
|
initialize: initialize,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var dom = require('../lib/dom')
|
var _ = require('../lib/helper');
|
||||||
, _ = require('../lib/helper')
|
var dom = require('../lib/dom');
|
||||||
, instances = require('./instances');
|
var instances = require('./instances');
|
||||||
|
|
||||||
module.exports = function (element) {
|
module.exports = function (element) {
|
||||||
var i = instances.get(element);
|
var i = instances.get(element);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var _ = require('../../lib/helper')
|
var _ = require('../../lib/helper');
|
||||||
, instances = require('../instances')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry')
|
var updateGeometry = require('../update-geometry');
|
||||||
, updateScroll = require('../update-scroll');
|
var updateScroll = require('../update-scroll');
|
||||||
|
|
||||||
function bindClickRailHandler(element, i) {
|
function bindClickRailHandler(element, i) {
|
||||||
function pageOffset(el) {
|
function pageOffset(el) {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var dom = require('../../lib/dom')
|
var _ = require('../../lib/helper');
|
||||||
, _ = require('../../lib/helper')
|
var dom = require('../../lib/dom');
|
||||||
, instances = require('../instances')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry')
|
var updateGeometry = require('../update-geometry');
|
||||||
, updateScroll = require('../update-scroll');
|
var updateScroll = require('../update-scroll');
|
||||||
|
|
||||||
function bindMouseScrollXHandler(element, i) {
|
function bindMouseScrollXHandler(element, i) {
|
||||||
var currentLeft = null;
|
var currentLeft = null;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var _ = require('../../lib/helper')
|
var _ = require('../../lib/helper');
|
||||||
, dom = require('../../lib/dom')
|
var dom = require('../../lib/dom');
|
||||||
, instances = require('../instances')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry')
|
var updateGeometry = require('../update-geometry');
|
||||||
, updateScroll = require('../update-scroll');
|
var updateScroll = require('../update-scroll');
|
||||||
|
|
||||||
function bindKeyboardHandler(element, i) {
|
function bindKeyboardHandler(element, i) {
|
||||||
var hovered = false;
|
var hovered = false;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var instances = require('../instances')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry')
|
var updateGeometry = require('../update-geometry');
|
||||||
, updateScroll = require('../update-scroll');
|
var updateScroll = require('../update-scroll');
|
||||||
|
|
||||||
function bindMouseWheelHandler(element, i) {
|
function bindMouseWheelHandler(element, i) {
|
||||||
var shouldPrevent = false;
|
var shouldPrevent = false;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var instances = require('../instances')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry');
|
var updateGeometry = require('../update-geometry');
|
||||||
|
|
||||||
function bindNativeScrollHandler(element, i) {
|
function bindNativeScrollHandler(element, i) {
|
||||||
i.event.bind(element, 'scroll', function () {
|
i.event.bind(element, 'scroll', function () {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var _ = require('../../lib/helper')
|
var _ = require('../../lib/helper');
|
||||||
, instances = require('../instances')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry')
|
var updateGeometry = require('../update-geometry');
|
||||||
, updateScroll = require('../update-scroll');
|
var updateScroll = require('../update-scroll');
|
||||||
|
|
||||||
function bindSelectionHandler(element, i) {
|
function bindSelectionHandler(element, i) {
|
||||||
function getRangeNode() {
|
function getRangeNode() {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var instances = require('../instances')
|
var _ = require('../../lib/helper');
|
||||||
, _ = require('../../lib/helper')
|
var instances = require('../instances');
|
||||||
, updateGeometry = require('../update-geometry')
|
var updateGeometry = require('../update-geometry');
|
||||||
, updateScroll = require('../update-scroll');
|
var updateScroll = require('../update-scroll');
|
||||||
|
|
||||||
function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
|
function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
|
||||||
function shouldPreventDefault(deltaX, deltaY) {
|
function shouldPreventDefault(deltaX, deltaY) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var cls = require('../lib/class')
|
var _ = require('../lib/helper');
|
||||||
, _ = require('../lib/helper')
|
var cls = require('../lib/class');
|
||||||
, instances = require('./instances')
|
var instances = require('./instances');
|
||||||
, updateGeometry = require('./update-geometry');
|
var updateGeometry = require('./update-geometry');
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
var handlers = {
|
var handlers = {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var cls = require('../lib/class')
|
var _ = require('../lib/helper');
|
||||||
, dom = require('../lib/dom')
|
var cls = require('../lib/class');
|
||||||
, defaultSettings = require('./default-setting')
|
var defaultSettings = require('./default-setting');
|
||||||
, EventManager = require('../lib/event-manager')
|
var dom = require('../lib/dom');
|
||||||
, guid = require('../lib/guid')
|
var EventManager = require('../lib/event-manager');
|
||||||
, _ = require('../lib/helper');
|
var guid = require('../lib/guid');
|
||||||
|
|
||||||
var instances = {};
|
var instances = {};
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var cls = require('../lib/class')
|
var _ = require('../lib/helper');
|
||||||
, dom = require('../lib/dom')
|
var cls = require('../lib/class');
|
||||||
, _ = require('../lib/helper')
|
var dom = require('../lib/dom');
|
||||||
, instances = require('./instances')
|
var instances = require('./instances');
|
||||||
, updateScroll = require('./update-scroll');
|
var updateScroll = require('./update-scroll');
|
||||||
|
|
||||||
function getThumbSize(i, thumbSize) {
|
function getThumbSize(i, thumbSize) {
|
||||||
if (i.settings.minScrollbarLength) {
|
if (i.settings.minScrollbarLength) {
|
||||||
|
@ -2,18 +2,18 @@
|
|||||||
|
|
||||||
var instances = require('./instances');
|
var instances = require('./instances');
|
||||||
|
|
||||||
var upEvent = document.createEvent('Event')
|
var upEvent = document.createEvent('Event');
|
||||||
, downEvent = document.createEvent('Event')
|
var downEvent = document.createEvent('Event');
|
||||||
, leftEvent = document.createEvent('Event')
|
var leftEvent = document.createEvent('Event');
|
||||||
, rightEvent = document.createEvent('Event')
|
var rightEvent = document.createEvent('Event');
|
||||||
, yEvent = document.createEvent('Event')
|
var yEvent = document.createEvent('Event');
|
||||||
, xEvent = document.createEvent('Event')
|
var xEvent = document.createEvent('Event');
|
||||||
, xStartEvent = document.createEvent('Event')
|
var xStartEvent = document.createEvent('Event');
|
||||||
, xEndEvent = document.createEvent('Event')
|
var xEndEvent = document.createEvent('Event');
|
||||||
, yStartEvent = document.createEvent('Event')
|
var yStartEvent = document.createEvent('Event');
|
||||||
, yEndEvent = document.createEvent('Event')
|
var yEndEvent = document.createEvent('Event');
|
||||||
, lastTop
|
var lastTop;
|
||||||
, lastLeft;
|
var lastLeft;
|
||||||
|
|
||||||
upEvent.initEvent('ps-scroll-up', true, true);
|
upEvent.initEvent('ps-scroll-up', true, true);
|
||||||
downEvent.initEvent('ps-scroll-down', true, true);
|
downEvent.initEvent('ps-scroll-down', true, true);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var dom = require('../lib/dom')
|
var _ = require('../lib/helper');
|
||||||
, _ = require('../lib/helper')
|
var dom = require('../lib/dom');
|
||||||
, instances = require('./instances')
|
var instances = require('./instances');
|
||||||
, updateGeometry = require('./update-geometry')
|
var updateGeometry = require('./update-geometry');
|
||||||
, updateScroll = require('./update-scroll');
|
var updateScroll = require('./update-scroll');
|
||||||
|
|
||||||
module.exports = function (element) {
|
module.exports = function (element) {
|
||||||
var i = instances.get(element);
|
var i = instances.get(element);
|
||||||
|
Loading…
Reference in New Issue
Block a user