luci-base: luci.js: support registering request progress handlers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
88969529f1
commit
d5e6688072
1 changed files with 3 additions and 0 deletions
|
@ -378,6 +378,9 @@
|
||||||
contenttype = opt.headers[header];
|
contenttype = opt.headers[header];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('progress' in opt && 'upload' in opt.xhr)
|
||||||
|
opt.xhr.upload.addEventListener('progress', opt.progress);
|
||||||
|
|
||||||
if (contenttype != null)
|
if (contenttype != null)
|
||||||
opt.xhr.setRequestHeader('Content-Type', contenttype);
|
opt.xhr.setRequestHeader('Content-Type', contenttype);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue