Skip to content

Commit

Permalink
feat(autoplay): Emit events for hoverpause (glidejs#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrzejchalubek committed Jul 7, 2019
1 parent c0db6ab commit 09a5983
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/autoplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ export default function (Glide, Components, Events) {
* @return {Void}
*/
bind () {
Binder.on('mouseover', Components.Html.root, () => {
Binder.on('mouseenter', Components.Html.root, () => {
this.stop()

Events.emit('autoplay.over')
})

Binder.on('mouseout', Components.Html.root, () => {
Binder.on('mouseleave', Components.Html.root, () => {
this.start()

Events.emit('autoplay.out')
})
},

Expand Down

0 comments on commit 09a5983

Please sign in to comment.