luci-base: luci.js: support registering request progress handlers
authorJo-Philipp Wich <jo@mein.io>
Tue, 3 Sep 2019 14:48:03 +0000 (16:48 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 10 Sep 2019 13:28:16 +0000 (15:28 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js

index 9d472dedc04428ae00b8841e025823688ecbe2e2..a9ddccf359b23599b50704975a9e36ef4d78488e 100644 (file)
                                                                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);