Skip to content

Commit

Permalink
Merge pull request HubSpot#210 from yannleretaille/master
Browse files Browse the repository at this point in the history
fixes issue that occurs when a previously registered event handler calls .off/.on
  • Loading branch information
also authored Jun 15, 2016
2 parents 99aceda + 6875efc commit 0b30fa8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion coffee/offline.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ Offline.off = (event, handler) ->

Offline.trigger = (event) ->
if handlers[event]?
for [ctx, handler] in handlers[event]
# we have to make a copy of the handlers since its possible that the called functions will modify the handlers array by calling off/on
for [ctx, handler] in handlers[event][..]
handler.call(ctx)

checkXHR = (xhr, onUp, onDown) ->
Expand Down

0 comments on commit 0b30fa8

Please sign in to comment.