show minimum of 0.1KB for small files in file editor

This commit is contained in:
Damian Schneider
2025-11-18 07:26:17 +01:00
parent 65c43b5224
commit aaad450175

View File

@@ -264,7 +264,7 @@ function createTree(element, editor){
leaf.textContent=name;
var span = cE("span");
span.style.cssText = "font-size: 14px; color: #aaa; margin-left: 8px;";
span.textContent = (size / 1024).toFixed(1) + "KB";
span.textContent = Math.max(0.1, (size / 1024)).toFixed(1) + "KB"; // show size in KB, minimum 0.1 to not show 0KB for small files
leaf.appendChild(span);
leaf.onmouseover=function(){ leaf.style.background="#333"; };
leaf.onmouseout=function(){ leaf.style.background=""; };