Fixed animated progress bar on app removal

pull/486/head
Gordon Williams 2020-06-04 12:52:16 +01:00
parent 57d89d3534
commit 08721cbe94
3 changed files with 5 additions and 4 deletions

View File

@ -22,3 +22,4 @@ Changed for individual apps are listed in `apps/appname/ChangeLog`
* App description can now be markdown
* Fix `marked is not defined` error (and include in repo, just in case)
* Fix error in 'Install Default Apps' if Flash storage is full enough that erasing takes a while
* Fixed animated progress bar on app removal

View File

@ -146,7 +146,7 @@ const Comms = {
},
removeAllApps : () => {
console.log("<COMMS> removeAllApps start");
Progress.show({title:"Removing all apps",progess:"animate",sticky:true});
Progress.show({title:"Removing all apps",percent:"animate",sticky:true});
return new Promise((resolve,reject) => {
var timeout = 5;
function handleResult(result,err) {

View File

@ -4,7 +4,7 @@
const Progress = {
domElement : null, // the DOM element
sticky : false, // Progress.show({..., sticky:true}) don't remove until Progress.hide({sticky:true})
interval : undefined, // the interval used if Progress.show({progress:"animate"})
interval : undefined, // the interval used if Progress.show({percent:"animate"})
percent : undefined, // the current progress percentage
min : 0, // scaling for percentage
max : 1, // scaling for percentage
@ -30,13 +30,13 @@ const Progress = {
clearInterval(Progress.interval);
Progress.interval = undefined;
}
if (percent == "animate") {
if (options.percent == "animate") {
Progress.interval = setInterval(function() {
Progress.percent += 2;
if (Progress.percent>100) Progress.percent=0;
Progress.show({percent:Progress.percent});
}, 100);
percent = 0;
Progress.percent = percent = 0;
}
let toastcontainer = document.getElementById("toastcontainer");