Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mjancarik committed Aug 3, 2017
2 parents 5de9f98 + 36f0714 commit a19945a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.DS_Store
node_modules/
dist/
package-lock.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/UIComponentHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -221,7 +221,7 @@ export default class UIComponentHelper {
*
* @param {number} visibilityId
*/
unregisterComponentToVisbility(visibilityId) {
unregisterComponentToVisibility(visibilityId) {
this._visibility.unregister(visibilityId);
}
}
8 changes: 4 additions & 4 deletions src/__tests__/UIComponentHelperSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,28 +145,28 @@ describe('UIComponentHelper', () => {

});

describe('registerComponentToVisbility method', () => {
describe('registerComponentToVisibility method', () => {
let reader = () => {};
let writer = () => {};
let options = { visibilityInterval: 180 };

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);
});
Expand Down
8 changes: 4 additions & 4 deletions src/iframe/HtmlIframe.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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() {
Expand Down Expand Up @@ -125,7 +125,7 @@ export default class HtmlIframe extends React.PureComponent {
}

_unregisterToCheckingVisibility() {
this.utils.$UIComponentHelper.unregisterComponentToVisbility(this._registeredVisibilityId);
this.utils.$UIComponentHelper.unregisterComponentToVisibility(this._registeredVisibilityId);
}

_registerToCheckingVisibility() {
Expand All @@ -134,7 +134,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,
{
Expand All @@ -143,7 +143,7 @@ export default class HtmlIframe extends React.PureComponent {
height: this.props.height
}
),
this._onVisbilityWriter
this._onVisibilityWriter
);
}
}
8 changes: 4 additions & 4 deletions src/image/HtmlImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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() {
Expand Down Expand Up @@ -138,7 +138,7 @@ export default class HtmlImage extends React.PureComponent {
}

_unregisterToCheckingVisibility() {
this.utils.$UIComponentHelper.unregisterComponentToVisbility(this._registeredVisibilityId);
this.utils.$UIComponentHelper.unregisterComponentToVisibility(this._registeredVisibilityId);
}

_registerToCheckingVisibility() {
Expand All @@ -147,7 +147,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,
{
Expand All @@ -156,7 +156,7 @@ export default class HtmlImage extends React.PureComponent {
height: this.props.height
}
),
this._onVisbilityWriter
this._onVisibilityWriter
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/video/HtmlVideo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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() {
Expand Down Expand Up @@ -125,15 +125,15 @@ export default class HtmlVideo extends React.PureComponent {
}

_unregisterToCheckingVisibility() {
this.utils.$UIComponentHelper.unregisterComponentToVisbility(this._registeredVisibilityId);
this.utils.$UIComponentHelper.unregisterComponentToVisibility(this._registeredVisibilityId);
}

_registerToCheckingVisibility() {
let extendedPadding = Math.max(
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,
{
Expand All @@ -142,7 +142,7 @@ export default class HtmlVideo extends React.PureComponent {
height: this.props.height
}
),
this._onVisbilityWriter
this._onVisibilityWriter
);
}

Expand Down

0 comments on commit a19945a

Please sign in to comment.