vue-scroll
Advanced tools
Comparing version 2.1.6 to 2.1.7
/** | ||
* vue-scroll v2.1.4 | ||
* (c) 2017 Wang Pin | ||
* vue-scroll v2.1.7 | ||
* (c) 2018 Wang Pin | ||
* @license MIT | ||
@@ -10,3 +10,8 @@ */ | ||
var _ = _interopDefault(require('lodash')); | ||
var _isObject = _interopDefault(require('lodash/isObject')); | ||
var _isFunction = _interopDefault(require('lodash/isFunction')); | ||
var _isInteger = _interopDefault(require('lodash/isInteger')); | ||
var _isFinite = _interopDefault(require('lodash/isFinite')); | ||
var _debounce = _interopDefault(require('lodash/debounce')); | ||
var _throttle = _interopDefault(require('lodash/throttle')); | ||
@@ -24,3 +29,3 @@ var dom = (function () { | ||
e = e || window.e; | ||
if (e.type === SCROLL) { | ||
@@ -39,12 +44,12 @@ if (target === document) { | ||
if (_.isObject(opt)) { | ||
if (_.isInteger(opt.throttle) && _.isFinite(opt.throttle) && opt.throttle > -1) { | ||
fn = _.throttle(fn, opt.throttle); | ||
if (_isObject(opt)) { | ||
if (_isInteger(opt.throttle) && _isFinite(opt.throttle) && opt.throttle > -1) { | ||
fn = _throttle(fn, opt.throttle); | ||
} | ||
if (_.isInteger(opt.debounce) && _.isFinite(opt.debounce) && opt.debounce > -1) { | ||
fn = _.debounce(fn, opt.debounce); | ||
if (_isInteger(opt.debounce) && _isFinite(opt.debounce) && opt.debounce > -1) { | ||
fn = _debounce(fn, opt.debounce); | ||
} | ||
} | ||
// https://github.com/wangpin34/vue-scroll/issues/1 | ||
@@ -64,9 +69,9 @@ if (event === SCROLL) { | ||
} | ||
function bind (element, event, fn, opt) { | ||
var funcs, eventFuncs; | ||
if (!_.isFunction(fn)) { | ||
if (!_isFunction(fn)) { | ||
throw new Error('Scroll handler is not a function'); | ||
@@ -78,5 +83,5 @@ } | ||
} | ||
funcs = listeners.get(element); | ||
if (!funcs.has(event)) { | ||
@@ -91,3 +96,3 @@ funcs.set(event, []); | ||
} | ||
eventFuncs.push(fn); | ||
@@ -101,3 +106,3 @@ | ||
if (!_.isFunction(fn)) { | ||
if (!_isFunction(fn)) { | ||
return; | ||
@@ -111,3 +116,3 @@ } | ||
funcs = listeners.get(element); | ||
if (!funcs.has(event)) { | ||
@@ -147,3 +152,3 @@ funcs.set(event, []); | ||
var fn, opt = Object.assign({}, options); | ||
if (_.isObject(value) || _.isFunction(value)) { | ||
if (_isObject(value) || _isFunction(value)) { | ||
fn = value; | ||
@@ -165,3 +170,3 @@ | ||
} | ||
} else { | ||
@@ -174,3 +179,3 @@ console.warn('Unexpected scroll properties'); | ||
var fn; | ||
if (_.isObject(value) || _.isFunction(value)) { | ||
if (_isObject(value) || _isFunction(value)) { | ||
fn = value; | ||
@@ -177,0 +182,0 @@ if (VALID_ARGS.indexOf(arg) > -1) { |
/** | ||
* vue-scroll v2.1.4 | ||
* (c) 2017 Wang Pin | ||
* vue-scroll v2.1.7 | ||
* (c) 2018 Wang Pin | ||
* @license MIT | ||
*/ | ||
import _ from 'lodash'; | ||
import _isObject from 'lodash/isObject'; | ||
import _isFunction from 'lodash/isFunction'; | ||
import _isInteger from 'lodash/isInteger'; | ||
import _isFinite from 'lodash/isFinite'; | ||
import _debounce from 'lodash/debounce'; | ||
import _throttle from 'lodash/throttle'; | ||
@@ -19,3 +24,3 @@ var dom = (function () { | ||
e = e || window.e; | ||
if (e.type === SCROLL) { | ||
@@ -34,12 +39,12 @@ if (target === document) { | ||
if (_.isObject(opt)) { | ||
if (_.isInteger(opt.throttle) && _.isFinite(opt.throttle) && opt.throttle > -1) { | ||
fn = _.throttle(fn, opt.throttle); | ||
if (_isObject(opt)) { | ||
if (_isInteger(opt.throttle) && _isFinite(opt.throttle) && opt.throttle > -1) { | ||
fn = _throttle(fn, opt.throttle); | ||
} | ||
if (_.isInteger(opt.debounce) && _.isFinite(opt.debounce) && opt.debounce > -1) { | ||
fn = _.debounce(fn, opt.debounce); | ||
if (_isInteger(opt.debounce) && _isFinite(opt.debounce) && opt.debounce > -1) { | ||
fn = _debounce(fn, opt.debounce); | ||
} | ||
} | ||
// https://github.com/wangpin34/vue-scroll/issues/1 | ||
@@ -59,9 +64,9 @@ if (event === SCROLL) { | ||
} | ||
function bind (element, event, fn, opt) { | ||
var funcs, eventFuncs; | ||
if (!_.isFunction(fn)) { | ||
if (!_isFunction(fn)) { | ||
throw new Error('Scroll handler is not a function'); | ||
@@ -73,5 +78,5 @@ } | ||
} | ||
funcs = listeners.get(element); | ||
if (!funcs.has(event)) { | ||
@@ -86,3 +91,3 @@ funcs.set(event, []); | ||
} | ||
eventFuncs.push(fn); | ||
@@ -96,3 +101,3 @@ | ||
if (!_.isFunction(fn)) { | ||
if (!_isFunction(fn)) { | ||
return; | ||
@@ -106,3 +111,3 @@ } | ||
funcs = listeners.get(element); | ||
if (!funcs.has(event)) { | ||
@@ -142,3 +147,3 @@ funcs.set(event, []); | ||
var fn, opt = Object.assign({}, options); | ||
if (_.isObject(value) || _.isFunction(value)) { | ||
if (_isObject(value) || _isFunction(value)) { | ||
fn = value; | ||
@@ -160,3 +165,3 @@ | ||
} | ||
} else { | ||
@@ -169,3 +174,3 @@ console.warn('Unexpected scroll properties'); | ||
var fn; | ||
if (_.isObject(value) || _.isFunction(value)) { | ||
if (_isObject(value) || _isFunction(value)) { | ||
fn = value; | ||
@@ -172,0 +177,0 @@ if (VALID_ARGS.indexOf(arg) > -1) { |
{ | ||
"name": "vue-scroll", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"description": "scroll directive for vuejs 2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-scroll.common.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
43021
1099
1