subscribe-ui-event
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -56,7 +56,7 @@ /** | ||
var top; | ||
if (eventType === 'scroll' && enableScrollInfo) { | ||
if (enableScrollInfo && eventType === 'scroll') { | ||
top = docEl.scrollTop + docBody.scrollTop; | ||
ae.scroll.delta = top - ae.scroll.top; | ||
ae.scroll.top = top; | ||
} else if (eventType === 'resize' && enableResizeInfo) { | ||
} else if (enableResizeInfo && eventType === 'resize') { | ||
ae.resize.width = win.innerWidth || docEl.clientWidth; | ||
@@ -103,2 +103,6 @@ ae.resize.height = win.innerHeight || docEl.clientHeight; | ||
return function(eeType, options) { | ||
// One subscription needs scroll/resize info, all will get those information | ||
enableScrollInfo = enableScrollInfo || options.enableScrollInfo; | ||
enableResizeInfo = enableResizeInfo || options.enableResizeInfo; | ||
if (ee.listeners(eeType, true)) { | ||
@@ -158,2 +162,6 @@ return; | ||
return function(eeType, options) { | ||
// One subscription needs scroll/resize info, all will get those information | ||
enableScrollInfo = enableScrollInfo || options.enableScrollInfo; | ||
enableResizeInfo = enableResizeInfo || options.enableResizeInfo; | ||
if (ee.listeners(eeType, true)) { | ||
@@ -166,4 +174,2 @@ return; | ||
var ae = new AugmentedEvent({type: eventType}); | ||
enableScrollInfo = enableScrollInfo || options.enableScrollInfo; | ||
enableResizeInfo = enableResizeInfo || options.enableResizeInfo; | ||
@@ -170,0 +176,0 @@ function eventHandler(e) { |
{ | ||
"name": "subscribe-ui-event", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A single, throttle built-in solution to subscribe to browser UI Events.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
31229
682