Reduce JavaScript footprint

This commit is contained in:
the-djmaze 2022-10-10 13:52:56 +02:00
parent 689126c57d
commit b12852bd08
42 changed files with 240 additions and 426 deletions

View file

@ -38,12 +38,12 @@ export class ComposeAttachmentModel extends AbstractModel {
this.addComputables({
progressText: () => {
const p = this.progress();
return 0 === p ? '' : '' + (98 < p ? 100 : p) + '%';
return 1 > p ? '' : (100 < p ? 100 : p) + '%';
},
progressStyle: () => {
const p = this.progress();
return 0 === p ? '' : 'width:' + (98 < p ? 100 : p) + '%';
return 1 > p ? '' : 'width:' + (100 < p ? 100 : p) + '%';
},
title: () => this.error() || this.fileName(),
@ -54,14 +54,9 @@ export class ComposeAttachmentModel extends AbstractModel {
},
mimeType: () => FileInfo.getContentType(this.fileName()),
fileExt: () => FileInfo.getExtension(this.fileName())
fileExt: () => FileInfo.getExtension(this.fileName()),
iconClass: () => FileInfo.getIconClass(this.fileExt(), this.mimeType())
});
}
/**
* @returns {string}
*/
iconClass() {
return FileInfo.getIconClass(this.fileExt(), this.mimeType());
}
}