summaryrefslogtreecommitdiffstats
path: root/afb-client/app/Frontend/widgets
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2015-12-21 16:10:40 +0100
committerFulup Ar Foll <fulup@iot.bzh>2015-12-21 16:10:40 +0100
commit4c75745c475edfbb6a9258ee80944e655fdf89f6 (patch)
tree25cb1f99bb4c8d0d669696ad0c720ab79920ed74 /afb-client/app/Frontend/widgets
parent20853066884b9d3cddfa29c9741d625ba625c5f3 (diff)
Fixed Warning
Diffstat (limited to 'afb-client/app/Frontend/widgets')
-rw-r--r--afb-client/app/Frontend/widgets/FormInput/UploadFiles.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js
index 8bc8eca..8c0a4c2 100644
--- a/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js
+++ b/afb-client/app/Frontend/widgets/FormInput/UploadFiles.js
@@ -43,8 +43,12 @@ var tmpl = '<input type="file" name="{{name}}-input" onchange="angular.element(
function LoadFileSvc (scope, elem, posturl, files, thumbnailCB) {
var xmlReq = new XMLHttpRequest();
var xform = new FormData();
-
- // Update slider during Upload
+
+ var OnLoadCB = function (target) {
+ var status = thumbnailCB (target);
+ //if (status) xform.append(scope.name, file, file.name);
+ };
+ // Update slider during Upload
xmlReq.upload.onprogress = function (event) {
var progress = Math.round(event.lengthComputable ? event.loaded * 100 / event.total : 0);
if (scope.slider) scope.slider.setValue (progress);
@@ -110,10 +114,7 @@ function LoadFileSvc (scope, elem, posturl, files, thumbnailCB) {
if (thumbnailCB) {
var reader = new FileReader();
reader.readAsArrayBuffer(file);
- reader.onload = function (target) {
- var status = thumbnailCB (target);
- //if (status) xform.append(scope.name, file, file.name);
- };
+ reader.onload = OnLoadCB;
}
// if everything is OK let's add file to xform
xform.append(scope.name, file, file.name);