summaryrefslogtreecommitdiff
path: root/js/cheesesteak.js
diff options
context:
space:
mode:
authorJuuso Lapinlampi <wub@partyvan.eu>2015-10-07 18:11:23 +0200
committerJuuso Lapinlampi <wub@partyvan.eu>2015-10-07 18:11:23 +0200
commitd3f9e9a2929301b19a69ade53a6051859883f7f8 (patch)
treea36034777000968138e4dde9b6b9b9f236fdaada /js/cheesesteak.js
parent85aec0691ab19aa1f9dcb501c77497fc21765c6c (diff)
Fix incorrect progress/load event listeners
This is a symptom of copy-paste code. A file would be uploaded, but it would return the "Something went wrong" error message without telling why. Me, ewhal@ and bursey on IRC tried had a look to see what was wrong, but none of us could catch this subtle bug. It wasn't until alchimist@ (cenci0) looked at this and found the issue. Thanks. This bug was introduced in commit 2751811.
Diffstat (limited to 'js/cheesesteak.js')
-rw-r--r--js/cheesesteak.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/cheesesteak.js b/js/cheesesteak.js
index 31d6086..e090a12 100644
--- a/js/cheesesteak.js
+++ b/js/cheesesteak.js
@@ -196,13 +196,13 @@
function postProgress(e) {
_this.emit('progress', e);
}
- xhr.upload.addEventListener('progress', postProgress);
+ xhr.addEventListener('progress', postProgress);
// Send a success/error response. Nothing more to do.
function uploadFinished(e) {
_this.emit('load', e, xhr.responseText);
}
- xhr.upload.addEventListener('load', uploadFinished);
+ xhr.addEventListener('load', uploadFinished);
xhr.send(data);