From d3f9e9a2929301b19a69ade53a6051859883f7f8 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Wed, 7 Oct 2015 16:11:23 +0000 Subject: 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. --- js/cheesesteak.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') 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); -- cgit v1.2.3