cleanup upload bar

This commit is contained in:
Pierre Dubouilh 2019-02-07 19:50:39 +01:00
parent 394040e9f5
commit 8e2f79067e
No known key found for this signature in database
GPG key ID: 8FE8BEDA9D4DB0D7
2 changed files with 10 additions and 3 deletions

View file

@ -24,6 +24,7 @@ const pageH1 = document.body.querySelector('h1')
const editor = document.getElementById('text-editor')
const crossIcon = document.getElementById('quitAll')
const toast = document.getElementById('toast')
const table = document.querySelector('table')
// helpers
let allA
@ -43,10 +44,9 @@ manualUpload.addEventListener('change', () => Array.from(manualUpload.files).for
function browseTo (href, flickerDone, skipHistory) {
fetch(href, { credentials: 'include' }).then(r => r.text().then(t => {
const parsed = new DOMParser().parseFromString(t, 'text/html')
const table = parsed.querySelectorAll('table')[0].innerHTML
document.body.querySelectorAll('table')[0].innerHTML = table
table.innerHTML = parsed.querySelector('table').innerHTML
const title = parsed.head.querySelectorAll('title')[0].innerText
const title = parsed.head.querySelector('title').innerText
// check if is current path - if so skip following
if (pageTitle.innerText !== title) {
pageTitle.innerText = title
@ -135,6 +135,7 @@ function shouldRefresh () {
totalUploadsSize = 0
totalUploadedSize = []
barDiv.style.display = 'none'
table.classList.remove('uploading-table')
refresh()
}
}
@ -151,6 +152,7 @@ function postFile (file, path) {
path = decodeURI(location.pathname).slice(0, -1) + path
window.onbeforeunload = warningMsg
table.classList.add('uploading-table')
barDiv.style.display = 'block'
totalUploads += 1
totalUploadsSize += file.size

View file

@ -148,6 +148,10 @@ h1 {
z-index: 101;
}
.uploading-table {
padding-bottom: 80px;
}
#progress {
width: 99%;
left: 0.5%;
@ -157,6 +161,7 @@ h1 {
padding-bottom: 10px;
max-height: 50%;
overflow-x: hidden;
background-color: #2d3436;
}
#dlBarName {