mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
storage tooltip format
storage in the tooltip in the dashboard storage bar, now looks like the size above , MB with 0 decimals and if more than 1 gb then in GB with 2 decimals
This commit is contained in:
@@ -69,8 +69,19 @@ $(window).on('resize', function(){
|
||||
tooltip.css('left', left+"px")
|
||||
});
|
||||
});
|
||||
|
||||
let size = 0;
|
||||
let str_size_type = "MB";
|
||||
let size_nb = 0;
|
||||
let str_size = "";
|
||||
{/literal}
|
||||
{foreach from=$STORAGE_CHART_DATA key=type item=value}
|
||||
size = {$value};
|
||||
str_size_type = size > 1000000 ? "GB" : "MB";
|
||||
size_nb = size > 1000000 ? (size / 1000000).toFixed(2) : (size / 1000).toFixed(0);
|
||||
str_size = " : " + size_nb.toString() + " " + str_size_type;
|
||||
$("#storage-{$type}").html("<b></b>" + str_size);
|
||||
$("#storage-{$type} b").html("{$type}");
|
||||
{/foreach}
|
||||
{/footer_script}
|
||||
|
||||
{html_style}
|
||||
@@ -229,7 +240,7 @@ $(window).on('resize', function(){
|
||||
|
||||
<div class="storage-tooltips">
|
||||
{foreach from=$STORAGE_CHART_DATA key=type item=value}
|
||||
<p id="storage-{$type}" class="tooltip"><b>{$type}</b> : {$value/1000} MB</p>
|
||||
<p id="storage-{$type}" class="tooltip"><b>{$type}</b></p>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user