show all parts in msd menu

This commit is contained in:
Maxim Devaev
2023-03-20 20:34:54 +02:00
parent 4f70060d5e
commit 2392aa2330
4 changed files with 39 additions and 10 deletions

View File

@@ -66,6 +66,10 @@ export var tools = new function() {
return id;
};
self.makeIdByText = function(text) {
return btoa(text).replace("=", "_");
};
self.formatSize = function(size) {
if (size > 0) {
let index = Math.floor( Math.log(size) / Math.log(1024) );
@@ -298,7 +302,7 @@ export var tools = new function() {
return {
"setValue": function(el, title, percent) {
el.setAttribute("data-label", title);
$(`${el.id}-value`).style.width = `${percent}%`;
el.querySelector(".progress-value").style.width = `${percent}%`;
},
"setPercentOf": function(el, max, value) {
let percent = Math.round(value * 100 / max);