From 696391d789dfa59f46a6f2b259467a690ec428ec Mon Sep 17 00:00:00 2001 From: Kaname Asakura Date: Tue, 16 Feb 2021 18:01:51 +0900 Subject: [PATCH] listen loadend event instead of load --- app/assets/javascripts/refile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/refile.js b/app/assets/javascripts/refile.js index 724f6a22..3a610dbe 100644 --- a/app/assets/javascripts/refile.js +++ b/app/assets/javascripts/refile.js @@ -43,7 +43,7 @@ xhr.file = file; - xhr.addEventListener("load", function() { + xhr.addEventListener("loadend", function() { xhr.complete = true; if(requests.every(function(xhr) { return xhr.complete })) { finalizeUpload(); @@ -64,7 +64,7 @@ dispatchEvent(input, "presign:start"); var presignXhr = new XMLHttpRequest(); var presignUrl = url + "?t=" + Date.now() + "." + index; - presignXhr.addEventListener("load", function() { + presignXhr.addEventListener("loadend", function() { dispatchEvent(input, "presign:complete"); if(isSuccess(presignXhr)) { dispatchEvent(input, "presign:success");