Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #121 from robertIsaac/fix-swiper
Browse files Browse the repository at this point in the history
add safe check to OCarouselContainerComponent to prevent throwing errors
  • Loading branch information
BehnooshShiva authored Oct 17, 2019
2 parents debd517 + 9303eaf commit f868fee
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,30 @@ import {
});
}
@HostListener('mouseenter') public onMouseEnter() {
this.swiper.autoplay.stop();
if (this.swiper) {
this.swiper.autoplay.stop();
}
this.pause = !this.pause;
}

@HostListener('mouseleave') public onMouseLeave() {
this.swiper.autoplay.start();
if (this.swiper) {
this.swiper.autoplay.start();
}
this.pause = !this.pause;
}

@HostListener('focus') public onFocusIn() {
this.swiper.autoplay.start();
if (this.swiper) {
this.swiper.autoplay.start();
}
this.pause = !this.pause;
}

@HostListener('blur') public onFocusOut() {
this.swiper.autoplay.start();
if (this.swiper) {
this.swiper.autoplay.start();
}
this.pause = !this.pause;
}
}

0 comments on commit f868fee

Please sign in to comment.