Extract the right target for clicks on nested elements

pull/1072/head
Stefan Selent 6 years ago
parent ec252ca6a4
commit ea57487453

@ -56,7 +56,7 @@ class app.views.OfflinePage extends app.View
action = 'install' if action is 'update' action = 'install' if action is 'update'
doc[action](@onInstallSuccess.bind(@, doc), @onInstallError.bind(@, doc), @onInstallProgress.bind(@, doc)) doc[action](@onInstallSuccess.bind(@, doc), @onInstallError.bind(@, doc), @onInstallProgress.bind(@, doc))
el.parentNode.innerHTML = "#{el.textContent.replace(/e$/, '')}ing…" el.parentNode.innerHTML = "#{el.textContent.replace(/e$/, '')}ing…"
else if action = el.getAttribute('data-action-all') else if action = el.getAttribute('data-action-all') || el.parentElement.getAttribute('data-action-all')
return unless action isnt 'uninstall' or window.confirm('Uninstall all docs?') return unless action isnt 'uninstall' or window.confirm('Uninstall all docs?')
app.db.migrate() app.db.migrate()
$.click(el) for el in @findAll("[data-action='#{action}']") $.click(el) for el in @findAll("[data-action='#{action}']")

Loading…
Cancel
Save