Trim history option in settings (UI only)

This commit is contained in:
yflory
2020-02-03 10:58:38 +01:00
parent 214d4e8e42
commit 19c329f6e7
5 changed files with 53 additions and 8 deletions

View File

@@ -30,6 +30,13 @@ define([
});
}
UIElements.prettySize = function (bytes) {
var kB = Util.bytesToKilobytes(bytes);
if (kB < 1024) { return kB + Messages.KB; }
var mB = Util.bytesToMegabytes(bytes);
return mB + Messages.MB;
};
UIElements.updateTags = function (common, href) {
var existing, tags;
NThen(function(waitFor) {

View File

@@ -224,6 +224,7 @@
else if (bytes >= oneMegabyte) { return 'MB'; }
};
// given a path, asynchronously return an arraybuffer
Util.fetch = function (src, cb, progress) {
var CB = Util.once(cb);

View File

@@ -182,13 +182,6 @@ define([
}
};
var prettySize = function (bytes) {
var kB = Util.bytesToKilobytes(bytes);
if (kB < 1024) { return kB + Messages.KB; }
var mB = Util.bytesToMegabytes(bytes);
return mB + Messages.MB;
};
queue.next = function () {
if (queue.queue.length === 0) {
clearTimeout(queue.to);
@@ -251,7 +244,7 @@ define([
// name
$('<td>').append($link).appendTo($tr);
// size
$('<td>').text(prettySize(estimate)).appendTo($tr);
$('<td>').text(UIElements.prettySize(estimate)).appendTo($tr);
// progress
$('<td>', {'class': 'cp-fileupload-table-progress'}).append($progressContainer).appendTo($tr);
// cancel