javascript: fix clicking on the icon of the auto-upload Retry button

When clicking on the icon, `event target` would be the icon, not
the button.

However delegates configures `this` to be the requested event target.
This commit is contained in:
Pierre de La Morinerie 2020-04-08 12:41:02 +02:00
parent aa2d99ef33
commit 38b0bd645c

View file

@ -16,8 +16,8 @@ delegate('change', fileInputSelector, event => {
});
const retryButtonSelector = `button.attachment-error-retry`;
delegate('click', retryButtonSelector, event => {
const inputSelector = event.target.dataset.inputTarget;
delegate('click', retryButtonSelector, function() {
const inputSelector = this.dataset.inputTarget;
const input = document.querySelector(inputSelector);
startUpload(input);
});