Skip to content

Commit

Permalink
Adds event data to swipe move event
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerlee committed Mar 18, 2020
1 parent e894ec3 commit b91b30a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function (Glide, Components, Events) {

Components.Html.root.classList.add(classes.dragging)

Events.emit('swipe.move')
Events.emit('swipe.move', null, swipe)
} else {
return false
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/event/events-bus.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class EventsBus {
* @param {String|Array} event
* @param {Object=} context
*/
emit (event, context) {
emit (event, context, eventData) {
if (isArray(event)) {
for (let i = 0; i < event.length; i++) {
this.emit(event[i], context)
Expand All @@ -64,7 +64,7 @@ export default class EventsBus {

// Cycle through events queue, fire!
this.events[event].forEach((item) => {
item(context || {})
item(context || {}, eventData)
})
}
}

0 comments on commit b91b30a

Please sign in to comment.