Skip to content

Commit c2e7102

Browse files
author
licong
committed
fix upload progress style
1 parent 9f9bd3d commit c2e7102

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Diff for: demo.gif

136 KB
Loading

Diff for: fs.go

+17-5
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ var tmpText = `
3030
<!DOCTYPE html>
3131
<html>
3232
<head>
33-
<style>
33+
<style>
34+
html {
35+
height: 100%;
36+
}
3437
a {
3538
color: #369;
3639
}
40+
body {
41+
margin-top: 0px;
42+
height: 100%;
43+
}
3744
#drop-area {
3845
border: 2px dashed #ccc;
3946
border-radius: 20px;
@@ -47,8 +54,15 @@ a {
4754
#fileElem {
4855
display: none;
4956
}
50-
#progress {
57+
progress {
58+
display: none;
5159
width: 100%;
60+
height: 10px;
61+
padding-top: 1px;
62+
margin-top: 0px;
63+
border: 1px #0064B4;
64+
background-color:#e6e6e6;
65+
color: #0064B4; /*IE10*
5266
}
5367
</style>
5468
</head>
@@ -117,13 +131,11 @@ function uploadFile(file, i) {
117131
xhr.open('POST', url, true)
118132
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest')
119133
let p = document.getElementById('progress')
134+
p.style.display = "inline-block"
120135
xhr.upload.onprogress = function(ev) {
121136
if(ev.lengthComputable) {
122137
p.max = ev.total
123138
p.value = ev.loaded
124-
console.info(p.value)
125-
console.info(p.max)
126-
console.info(p)
127139
}
128140
}
129141

0 commit comments

Comments
 (0)