From: Jo-Philipp Wich Date: Tue, 3 Sep 2019 14:48:03 +0000 (+0200) Subject: luci-base: luci.js: support registering request progress handlers X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d5e6688072e345dd0e455b0832b4393994e9be7c;p=openwrt-luci.git luci-base: luci.js: support registering request progress handlers Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 9d472dedc0..a9ddccf359 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);