Skip to content

Commit

Permalink
refactor(src): add more resilience at onToggleLoop method
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopaulovieira committed Feb 28, 2020
1 parent 842c4ca commit df55c47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ export default class ContextMenuPlugin extends UICorePlugin {
}

onToggleLoop() {
this.core.options.loop = !this.loopEnable
this.core.activePlayback.el.loop = !this.loopEnable
this.core.options && (this.core.options.loop = !this.loopEnable)
this.core.activePlayback && this.core.activePlayback.el && (this.core.activePlayback.el.loop = !this.loopEnable)
this.$el.find('[data-loop]').toggleClass('on', this.loopEnable)
this.$el.find('[data-loop]').toggleClass('off', !this.loopEnable)
}
Expand Down

0 comments on commit df55c47

Please sign in to comment.