add pretty-printers for byte-counts

This commit is contained in:
ansuz
2017-04-18 15:44:15 +02:00
parent 2a25afae5f
commit 2b8579e8b7
3 changed files with 11 additions and 5 deletions

View File

@@ -226,10 +226,6 @@ define([
return $div;
};
var bytesToMegabytes = function (bytes) {
return Math.floor((bytes / (1024 * 1024) * 100)) / 100;
};
var createUsageButton = function (obj) {
var proxy = obj.proxy;
@@ -252,7 +248,7 @@ define([
Cryptpad.alert(Messages.settings_pinningError);
return;
}
Cryptpad.alert(Messages._getKey('settings_usageAmount', [bytesToMegabytes(bytes)]));
Cryptpad.alert(Messages._getKey('settings_usageAmount', [Cryptpad.bytesToMegabytes(bytes)]));
});
})
.appendTo($div);