summaryrefslogtreecommitdiff
path: root/web/share/js/tools.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js/tools.js')
-rw-r--r--web/share/js/tools.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/web/share/js/tools.js b/web/share/js/tools.js
index 07c8da19..13183659 100644
--- a/web/share/js/tools.js
+++ b/web/share/js/tools.js
@@ -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);