Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 701c2be6
authored
Feb 24, 2019
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure upload progress stays within bounds
1 parent
7c15fe4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
frontend/js/app.js
frontend/js/app.js
View file @
701c2be
...
@@ -171,7 +171,8 @@ function uploadFiles(files) {
...
@@ -171,7 +171,8 @@ function uploadFiles(files) {
if
(
!
(
event
.
target
instanceof
XMLHttpRequestUpload
))
return
;
if
(
!
(
event
.
target
instanceof
XMLHttpRequestUpload
))
return
;
app
.
uploadStatus
.
done
=
finishedUploadSize
+
event
.
loaded
;
app
.
uploadStatus
.
done
=
finishedUploadSize
+
event
.
loaded
;
app
.
uploadStatus
.
percentDone
=
Math
.
round
(
app
.
uploadStatus
.
done
/
app
.
uploadStatus
.
size
*
100
);
var
tmp
=
Math
.
round
(
app
.
uploadStatus
.
done
/
app
.
uploadStatus
.
size
*
100
);
app
.
uploadStatus
.
percentDone
=
tmp
>
100
?
100
:
tmp
;
}).
end
(
function
(
error
,
result
)
{
}).
end
(
function
(
error
,
result
)
{
if
(
result
&&
result
.
statusCode
===
401
)
return
logout
();
if
(
result
&&
result
.
statusCode
===
401
)
return
logout
();
if
(
result
&&
result
.
statusCode
!==
201
)
return
callback
(
'Error uploading file: '
,
result
.
statusCode
);
if
(
result
&&
result
.
statusCode
!==
201
)
return
callback
(
'Error uploading file: '
,
result
.
statusCode
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment