From d5e6688072e345dd0e455b0832b4393994e9be7c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 3 Sep 2019 16:48:03 +0200 Subject: [PATCH] luci-base: luci.js: support registering request progress handlers Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/luci.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 9d472dedc..a9ddccf35 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -378,6 +378,9 @@ contenttype = opt.headers[header]; } + if ('progress' in opt && 'upload' in opt.xhr) + opt.xhr.upload.addEventListener('progress', opt.progress); + if (contenttype != null) opt.xhr.setRequestHeader('Content-Type', contenttype); -- 2.25.1