From 3c558e7c32b71859e95faa33b5caf56ddbec356f Mon Sep 17 00:00:00 2001 From: Ondrej Base Date: Tue, 1 Aug 2017 11:55:06 +0200 Subject: [PATCH] #19 Visbility renamed to Visibility --- .gitignore | 1 + package.json | 2 +- src/UIComponentHelper.js | 4 ++-- src/__tests__/UIComponentHelperSpec.js | 8 ++++---- src/iframe/HtmlIframe.jsx | 8 ++++---- src/image/HtmlImage.jsx | 8 ++++---- src/video/HtmlVideo.jsx | 8 ++++---- 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index b7d6758..3a72c91 100755 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .DS_Store node_modules/ dist/ +package-lock.json diff --git a/package.json b/package.json index 8a9f969..91e76b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ima-ui-atoms", - "version": "0.10.1", + "version": "0.10.2", "description": "IMA.js UI React atoms", "main": "main.js", "scripts": { diff --git a/src/UIComponentHelper.js b/src/UIComponentHelper.js index 3504864..2a55068 100644 --- a/src/UIComponentHelper.js +++ b/src/UIComponentHelper.js @@ -212,7 +212,7 @@ export default class UIComponentHelper { * @param {{ visibilityInterval: number }} options * @return {number} The registered id */ - registerComponentToVisbility(reader, writer, options = { visibilityInterval: 180 }) { + registerComponentToVisibility(reader, writer, options = { visibilityInterval: 180 }) { return this._visibility.register(reader, writer, options); } @@ -221,7 +221,7 @@ export default class UIComponentHelper { * * @param {number} visibilityId */ - unregisterComponentToVisbility(visibilityId) { + unregisterComponentToVisibility(visibilityId) { this._visibility.unregister(visibilityId); } } diff --git a/src/__tests__/UIComponentHelperSpec.js b/src/__tests__/UIComponentHelperSpec.js index 6b8c260..b4ae3e9 100644 --- a/src/__tests__/UIComponentHelperSpec.js +++ b/src/__tests__/UIComponentHelperSpec.js @@ -145,7 +145,7 @@ describe('UIComponentHelper', () => { }); - describe('registerComponentToVisbility method', () => { + describe('registerComponentToVisibility method', () => { let reader = () => {}; let writer = () => {}; let options = { visibilityInterval: 180 }; @@ -153,20 +153,20 @@ describe('UIComponentHelper', () => { it('should call Visibility.register method', () => { spyOn(visibility, 'register'); - uiComponentHelper.registerComponentToVisbility(reader, writer, options); + uiComponentHelper.registerComponentToVisibility(reader, writer, options); expect(visibility.register).toHaveBeenCalledWith(reader, writer, options); }); }); - describe('unregisterComponentToVisbility method', () => { + describe('unregisterComponentToVisibility method', () => { let visibilityId = 0; it('should call Visibility.unregister method', () => { spyOn(visibility, 'unregister'); - uiComponentHelper.unregisterComponentToVisbility(visibilityId); + uiComponentHelper.unregisterComponentToVisibility(visibilityId); expect(visibility.unregister).toHaveBeenCalledWith(visibilityId); }); diff --git a/src/iframe/HtmlIframe.jsx b/src/iframe/HtmlIframe.jsx index 739d539..90b0179 100644 --- a/src/iframe/HtmlIframe.jsx +++ b/src/iframe/HtmlIframe.jsx @@ -30,7 +30,7 @@ export default class HtmlIframe extends React.PureComponent { this._registeredVisibilityId = null; - this._onVisbilityWriter = this.onVisibilityWriter.bind(this); + this._onVisibilityWriter = this.onVisibilityWriter.bind(this); } get utils() { @@ -127,7 +127,7 @@ export default class HtmlIframe extends React.PureComponent { } _unregisterToCheckingVisibility() { - this.utils.$UIComponentHelper.unregisterComponentToVisbility(this._registeredVisibilityId); + this.utils.$UIComponentHelper.unregisterComponentToVisibility(this._registeredVisibilityId); } _registerToCheckingVisibility() { @@ -136,7 +136,7 @@ export default class HtmlIframe extends React.PureComponent { MIN_EXTENDED_PADDING ); - this._registeredVisibilityId = this.utils.$UIComponentHelper.registerComponentToVisbility( + this._registeredVisibilityId = this.utils.$UIComponentHelper.registerComponentToVisibility( this.utils.$UIComponentHelper.getVisibilityReader( this.refs.root, { @@ -145,7 +145,7 @@ export default class HtmlIframe extends React.PureComponent { height: this.props.height } ), - this._onVisbilityWriter + this._onVisibilityWriter ); } } diff --git a/src/image/HtmlImage.jsx b/src/image/HtmlImage.jsx index 136f517..f0150a7 100644 --- a/src/image/HtmlImage.jsx +++ b/src/image/HtmlImage.jsx @@ -37,7 +37,7 @@ export default class HtmlImage extends React.PureComponent { this._registeredVisibilityId = null; - this._onVisbilityWriter = this.onVisibilityWriter.bind(this); + this._onVisibilityWriter = this.onVisibilityWriter.bind(this); } get utils() { @@ -140,7 +140,7 @@ export default class HtmlImage extends React.PureComponent { } _unregisterToCheckingVisibility() { - this.utils.$UIComponentHelper.unregisterComponentToVisbility(this._registeredVisibilityId); + this.utils.$UIComponentHelper.unregisterComponentToVisibility(this._registeredVisibilityId); } _registerToCheckingVisibility() { @@ -149,7 +149,7 @@ export default class HtmlImage extends React.PureComponent { MIN_EXTENDED_PADDING ); - this._registeredVisibilityId = this.utils.$UIComponentHelper.registerComponentToVisbility( + this._registeredVisibilityId = this.utils.$UIComponentHelper.registerComponentToVisibility( this.utils.$UIComponentHelper.getVisibilityReader( this.refs.root, { @@ -158,7 +158,7 @@ export default class HtmlImage extends React.PureComponent { height: this.props.height } ), - this._onVisbilityWriter + this._onVisibilityWriter ); } diff --git a/src/video/HtmlVideo.jsx b/src/video/HtmlVideo.jsx index 3f30498..f5975d1 100644 --- a/src/video/HtmlVideo.jsx +++ b/src/video/HtmlVideo.jsx @@ -33,7 +33,7 @@ export default class HtmlVideo extends React.PureComponent { this._registeredVisibilityId = null; - this._onVisbilityWriter = this.onVisibilityWriter.bind(this); + this._onVisibilityWriter = this.onVisibilityWriter.bind(this); } get utils() { @@ -127,7 +127,7 @@ export default class HtmlVideo extends React.PureComponent { } _unregisterToCheckingVisibility() { - this.utils.$UIComponentHelper.unregisterComponentToVisbility(this._registeredVisibilityId); + this.utils.$UIComponentHelper.unregisterComponentToVisibility(this._registeredVisibilityId); } _registerToCheckingVisibility() { @@ -135,7 +135,7 @@ export default class HtmlVideo extends React.PureComponent { Math.round(this.utils.$UIComponentHelper.getWindowViewportRect().height / 2), EXTENDED_PADDING ); - this._registeredVisibilityId = this.utils.$UIComponentHelper.registerComponentToVisbility( + this._registeredVisibilityId = this.utils.$UIComponentHelper.registerComponentToVisibility( this.utils.$UIComponentHelper.getVisibilityReader( this.refs.root, { @@ -144,7 +144,7 @@ export default class HtmlVideo extends React.PureComponent { height: this.props.height } ), - this._onVisbilityWriter + this._onVisibilityWriter ); }