First commit
This commit is contained in:
49
framework/client/progressBar.js
Normal file
49
framework/client/progressBar.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2020, 2023, The Unified Company.
|
||||
|
||||
This code is part of Unify.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE,
|
||||
as published by the Free Software Foundation.
|
||||
See the GNU AFFERO GENERAL PUBLIC LICENSE, for more details.
|
||||
|
||||
https://unifyjs.org
|
||||
|
||||
*/
|
||||
|
||||
export default class progressBar{
|
||||
|
||||
progress = 0;
|
||||
|
||||
element = document.querySelector(".progressBar");
|
||||
|
||||
set( newProgress ) {
|
||||
|
||||
var difference = newProgress - this.progress;
|
||||
|
||||
this.progress = newProgress;
|
||||
|
||||
//console.log("difference", difference, newProgress);
|
||||
|
||||
}
|
||||
|
||||
setApplicationProgress( newProgress, applicationID ) {
|
||||
|
||||
var beforeProgress = 40;
|
||||
|
||||
var currentApplicationProgress = ( newProgress / document.applications.length );
|
||||
|
||||
var currentProgress = currentApplicationProgress * applicationID;
|
||||
|
||||
var progress = beforeProgress + currentProgress;
|
||||
|
||||
|
||||
this.set( progress )
|
||||
|
||||
this.progress = progress;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user