add status with used/granted disk usage

This commit is contained in:
j 2015-03-27 22:46:52 +01:00
parent 146a1ca39a
commit b9220e6820

View file

@ -87,7 +87,16 @@ pandora.ui.cacheDialog = function() {
}
}),
$statusbar = Ox.Bar({size: 16}),
$status = $('<div>')
.css({
width: '100%',
marginTop: '2px',
fontSize: '9px',
textAlign: 'center',
textOverflow: 'ellipsis'
}),
$statusbar = Ox.Bar({size: 16}).append($status),
$panel = Ox.SplitPanel({
elements: [
@ -319,8 +328,18 @@ pandora.ui.cacheDialog = function() {
$list.value(file.id, 'progress', file.progress);
}
});
updateStatus();
});
}
function updateStatus() {
navigator.webkitPersistentStorage.queryUsageAndQuota(function(usage, quota) {
$status.html(
Ox.formatValue(usage, 'B', true) + ' of ' + Ox.formatValue(quota, 'B', true)
);
})
}
return that;