Skip to content

Commit

Permalink
Merge pull request #520 from videogular/fix/optional-skip-button
Browse files Browse the repository at this point in the history
fix(ima-ads): Set skip button as optional
  • Loading branch information
Elecash authored May 12, 2017
2 parents 88f7af1 + e6072d3 commit 17d23f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ima-ads/vg-ima-ads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ export class VgImaAds implements OnInit, OnDestroy {
initializations() {
this.ima = new Ima(this.elem);

this.skipButton = document.querySelector(this.vgSkipButton) as HTMLElement;
this.skipButton.style.display = 'none';
this.skipButton.addEventListener('click', this.onClickSkip.bind(this));
this.elem.insertBefore(this.skipButton, this.elem.firstChild);
if (this.vgSkipButton) {
this.skipButton = document.querySelector(this.vgSkipButton) as HTMLElement;
this.skipButton.style.display = 'none';
this.skipButton.addEventListener('click', this.onClickSkip.bind(this));
this.elem.insertBefore(this.skipButton, this.elem.firstChild);
}

window.addEventListener('resize', () => {
const w = this.API.videogularElement.offsetWidth;
Expand Down

0 comments on commit 17d23f4

Please sign in to comment.