Skip to content

Commit

Permalink
Bump subscribe-ui-event
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-rhsiao committed May 11, 2018
1 parent 5337a0f commit 50a7197
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"debug": "^3.1.0",
"hoist-non-react-statics": "^2.0.0",
"prop-types": "^15.5.10",
"subscribe-ui-event": "^1.0.14"
"subscribe-ui-event": "^2.0.0"
},
"devDependencies": {
"babel": "^6.5.2",
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ComponentSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ var ReactI13n = require('./ReactI13n');
var ViewportDetector = require('./ViewportDetector');
var clickHandler = require('./clickHandler');
var debug = require('debug')('I13nComponent');
var listen = require('subscribe-ui-event/dist/lib/listen');
var subscribe = require('subscribe-ui-event/dist/subscribe');
var listen = require('subscribe-ui-event').listen;
var subscribe = require('subscribe-ui-event').subscribe;

var IS_DEBUG_MODE = (function isDebugMode () {
function getJsonFromUrl() {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/DebugDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
/* global document, window*/
var listen = require('subscribe-ui-event/dist/lib/listen');
var listen = require('subscribe-ui-event').listen;

var supportClassList = false;
var uniqueId = 0;
Expand Down
14 changes: 7 additions & 7 deletions src/libs/ViewportDetector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
* Copyright 2015, Yahoo Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var subscribe = require('subscribe-ui-event/dist/subscribe');
var subscribe = require('subscribe-ui-event').subscribe;

var SUBSCRIBE_OPTIONS = {
var SUBSCRIBE_OPTIONS = {
enableScrollInfo: true
};

var DEFAULT_VIEWPORT_MARGINS = {
var DEFAULT_VIEWPORT_MARGINS = {
usePercent: false,
top: 20,
bottom: 20
Expand All @@ -19,8 +19,8 @@ var DEFAULT_VIEWPORT_MARGINS = {
* @param {Object} element DOM element to detect
* @param {Object} [options] options object
* @param {Object} [options.margins] viewport detection margin setting
* @param {Object} [options.margins.top] viewport top margin setting
* @param {Object} [options.margins.bottom] viewport bottom margin setting
* @param {Object} [options.margins.top] viewport top margin setting
* @param {Object} [options.margins.bottom] viewport bottom margin setting
* @param {Object} [options.margins.usePercent] true to use top and bottom as percentage instead of pixel
* @param {Object} [options.target] target of ui events, should be a dom element
* @param {Function} onEnterViewport callback when the DOM element enters the viewport
Expand All @@ -32,9 +32,9 @@ var ViewportDetector = function ViewportDetector(element, options, onEnterViewpo

this._element = element;
this._onEnterViewport = onEnterViewport;
this._subscribers = [];
this._subscribers = [];
this._rect;
this._margins = {
this._margins = {
top: marginOptions.usePercent ? marginOptions.top * clientHeight : marginOptions.top,
bottom: marginOptions.usePercent ? marginOptions.bottom * clientHeight : marginOptions.bottom
};
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/utils/createI13nNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ describe('createI13nNode', function () {
createReactClass = require('create-react-class');

mockery.registerMock('../libs/ReactI13n', MockReactI13n);
mockery.registerMock('subscribe-ui-event/dist/subscribe', mockSubscribe.subscribe);
mockery.registerMock('subscribe-ui-event/dist/listen', mockSubscribe.listen);
mockery.registerMock('subscribe-ui-event', mockSubscribe);
mockery.registerMock('../libs/clickHandler', mockClickHandler);

createI13nNode = require('../../../src/utils/createI13nNode');
Expand Down

0 comments on commit 50a7197

Please sign in to comment.