Description
Hi,
We'be been using activeadmin with turbolinks quite successfully for some time. While migrating to Turbolinks 5, I encountered an issue on batch actions : seems like both ready
and turbolinks:load
are trigger, which causes click handler to be attached twice.
I've recreated a simple project from scratch to check if that wasn't coming from our side and I do reproduce it. Basically just a brand new default rails app with activeadmin. Source code and live demo are available. Just go to admin/items
directly, select items then Batch Actions
> Delete Selected Items
. The modal is then opened twice as you can see in this screenshot :
Looks like every version between 1.0.0 and 1.3.1 are affected (master might be as well). A possible solution would be to detach previously attached click handler here like this :
$('.batch_actions_selector li a').off('click').on 'click', (e)->
I'd be happy to do a PR if that solution seems acceptable. I'm open to other solutions/workarounds/.. as well.
Best!