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>
|
||||
<script>
|
||||
var container = document.querySelector('.container')
|
||||
, axis = document.getElementById('axis')
|
||||
, direction = document.getElementById('direction')
|
||||
, startEnd = document.getElementById('start-end');
|
||||
var container = document.querySelector('.container');
|
||||
var axis = document.getElementById('axis');
|
||||
var direction = document.getElementById('direction');
|
||||
var startEnd = document.getElementById('start-end');
|
||||
|
||||
Ps.initialize(container);
|
||||
|
||||
document.addEventListener('ps-scroll-y', function () {
|
||||
@ -83,7 +84,6 @@
|
||||
document.addEventListener('ps-x-reach-end', function () {
|
||||
startEnd.innerHTML = 'Reached end of <em>X-Axis</em>'
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
30
gulpfile.js
30
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';
|
||||
|
||||
|
4
src/js/adaptor/jquery.js
vendored
4
src/js/adaptor/jquery.js
vendored
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 () {
|
||||
|
@ -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() {
|
||||
|
@ -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) {
|
||||
|
@ -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 = {
|
||||
|
@ -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 = {};
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user