').append($att);
+ const $container = $('
').append($att);
this.$attachment.append($container);
@@ -682,16 +687,16 @@ class FileFieldView extends LinkFieldView {
return $att;
}
- let $loading = $('')
+ const $loading = $('')
.addClass('small uploading-message')
.text(this.translate('Uploading...'));
$container.append($loading);
$att.on('ready', () => {
- let id = this.model.get(this.idName);
+ const id = this.model.get(this.idName);
- let previewHtml = this.getBoxPreviewHtml(name, type, id);
+ const previewHtml = this.getBoxPreviewHtml(name, type, id);
$att.find('.preview').html(previewHtml);
@@ -706,9 +711,8 @@ class FileFieldView extends LinkFieldView {
}
insertFromSource(source) {
- let viewName =
- this.getMetadata()
- .get(['clientDefs', 'Attachment', 'sourceDefs', source, 'insertModalView']) ||
+ const viewName =
+ this.getMetadata().get(['clientDefs', 'Attachment', 'sourceDefs', source, 'insertModalView']) ||
this.getMetadata().get(['clientDefs', source, 'modalViews', 'select']) ||
'views/modals/select-records';
@@ -799,7 +803,7 @@ class FileFieldView extends LinkFieldView {
}
fetch() {
- let data = {};
+ const data = {};
data[this.idName] = this.model.get(this.idName);