(In reply to Christoph Kerschbaumer [:ckerschb] from comment #6)
I think I figured what the problem is, the original code used an "oncommand" handler . Within onDownLoadClick  the event does not get treated if it has the attribute "oncommand".
Gah. This is horrible. :-(
Question is, how do we fix that? Can we somehow check if an "command" event listener was added using .addEventListener? Or is there a better approach?
I'm pretty sure
event.originalTarget.localName == "button" should do the trick. Still ugly though. Might be worth adding a comment in the code that has the markup to indicate this could potentially be a problem if people changed the markup.
Other options involve also adding a
click handler on the button and calling stopPropagation() in there, but that might prevent the
command event being created, I'm not sure, and also wouldn't scale to trying to handle the command events more centrally if we wanted to avoid N handlers for N download items. That latter objection also applies to a third option, which would be to use the event listener service (
Services.els.getListenerInfoFor); to ask the DOM whether there's a "command" event listener registerd on the