Attachmnet => Attachment

This commit is contained in:
the-djmaze 2022-01-17 16:39:10 +01:00
parent e6290e06e9
commit 638128ff93
3 changed files with 13 additions and 13 deletions

View file

@ -124,7 +124,7 @@ export class MailMessageView extends AbstractViewRight {
this.oMessageScrollerDom = null; this.oMessageScrollerDom = null;
this.addObservables({ this.addObservables({
showAttachmnetControls: false, showAttachmentControls: false,
downloadAsZipLoading: false, downloadAsZipLoading: false,
lastReplyAction_: '', lastReplyAction_: '',
showFullInfo: '1' === Local.get(ClientSideKeyName.MessageHeaderFullInfo), showFullInfo: '1' === Local.get(ClientSideKeyName.MessageHeaderFullInfo),
@ -150,7 +150,7 @@ export class MailMessageView extends AbstractViewRight {
this.messageListOfThreadsLoading = ko.observable(false).extend({ rateLimit: 1 }); this.messageListOfThreadsLoading = ko.observable(false).extend({ rateLimit: 1 });
this.highlightUnselectedAttachments = ko.observable(false).extend({ falseTimeout: 2000 }); this.highlightUnselectedAttachments = ko.observable(false).extend({ falseTimeout: 2000 });
this.showAttachmnetControlsState = v => Local.set(ClientSideKeyName.MessageAttachmentControls, !!v); this.showAttachmentControlsState = v => Local.set(ClientSideKeyName.MessageAttachmentControls, !!v);
this.downloadAsZipError = ko.observable(false).extend({ falseTimeout: 7000 }); this.downloadAsZipError = ko.observable(false).extend({ falseTimeout: 7000 });
@ -198,9 +198,9 @@ export class MailMessageView extends AbstractViewRight {
}); });
this.addComputables({ this.addComputables({
allowAttachmnetControls: () => this.attachmentsActions.length && Settings.capa(Capa.AttachmentsActions), allowAttachmentControls: () => this.attachmentsActions.length && Settings.capa(Capa.AttachmentsActions),
downloadAsZipAllowed: () => this.attachmentsActions.includes('zip') && this.allowAttachmnetControls(), downloadAsZipAllowed: () => this.attachmentsActions.includes('zip') && this.allowAttachmentControls(),
lastReplyAction: { lastReplyAction: {
read: this.lastReplyAction_, read: this.lastReplyAction_,
@ -248,7 +248,7 @@ export class MailMessageView extends AbstractViewRight {
}); });
this.addSubscribables({ this.addSubscribables({
showAttachmnetControls: v => MessageUserStore.message() showAttachmentControls: v => MessageUserStore.message()
&& MessageUserStore.message().attachments.forEach(item => item && item.checked(!!v)), && MessageUserStore.message().attachments.forEach(item => item && item.checked(!!v)),
lastReplyAction_: value => Local.set(ClientSideKeyName.LastReplyAction, value), lastReplyAction_: value => Local.set(ClientSideKeyName.LastReplyAction, value),
@ -257,10 +257,10 @@ export class MailMessageView extends AbstractViewRight {
this.messageActiveDom(null); this.messageActiveDom(null);
if (message) { if (message) {
this.showAttachmnetControls(false); this.showAttachmentControls(false);
if (Local.get(ClientSideKeyName.MessageAttachmentControls)) { if (Local.get(ClientSideKeyName.MessageAttachmentControls)) {
setTimeout(() => { setTimeout(() => {
this.showAttachmnetControls(true); this.showAttachmentControls(true);
}, 50); }, 50);
} }

View file

@ -253,7 +253,7 @@ trait Messages
\fclose($rMessageStream); \fclose($rMessageStream);
} }
$this->deleteMessageAttachmnets($oAccount); $this->deleteMessageAttachments($oAccount);
$sDraftFolder = $this->GetActionParam('MessageFolder', ''); $sDraftFolder = $this->GetActionParam('MessageFolder', '');
$iDraftUid = (int) $this->GetActionParam('MessageUid', 0); $iDraftUid = (int) $this->GetActionParam('MessageUid', 0);
@ -820,7 +820,7 @@ trait Messages
return $this->TrueResponse($sResponseFunction); return $this->TrueResponse($sResponseFunction);
} }
private function deleteMessageAttachmnets(Account $oAccount) : void private function deleteMessageAttachments(Account $oAccount) : void
{ {
$aAttachments = $this->GetActionParam('Attachments', null); $aAttachments = $this->GetActionParam('Attachments', null);

View file

@ -274,7 +274,7 @@
<span class="text" data-i18n="MESSAGE/BUTTON_NOTIFY_READ_RECEIPT"></span> <span class="text" data-i18n="MESSAGE/BUTTON_NOTIFY_READ_RECEIPT"></span>
</div> </div>
<div class="attachmentsPlace" data-bind="visible: message() && message().attachments().hasVisible(), <div class="attachmentsPlace" data-bind="visible: message() && message().attachments().hasVisible(),
css: {'selection-mode' : showAttachmnetControls, 'unselectedAttachmentsError': highlightUnselectedAttachments}"> css: {'selection-mode' : showAttachmentControls, 'unselectedAttachmentsError': highlightUnselectedAttachments}">
<ul class="attachmentList" data-bind="foreach: message() ? message().attachments() : []"> <ul class="attachmentList" data-bind="foreach: message() ? message().attachments() : []">
<li class="attachmentItem" draggable="true" <li class="attachmentItem" draggable="true"
data-bind="visible: !isLinked, event: { 'dragstart': eventDragStart }, attr: { 'title': fileName }, css: {'checked': checked}"> data-bind="visible: !isLinked, event: { 'dragstart': eventDragStart }, attr: { 'title': fileName }, css: {'checked': checked}">
@ -301,11 +301,11 @@
click: function () { checked(!checked()); return false }"></div> click: function () { checked(!checked()); return false }"></div>
</li> </li>
</ul> </ul>
<i class="fontastic controls-handle" data-bind="visible: allowAttachmnetControls() && !showAttachmnetControls(), click: function () { showAttachmnetControls(true); showAttachmnetControlsState(true); }"></i> <i class="fontastic controls-handle" data-bind="visible: allowAttachmentControls() && !showAttachmentControls(), click: function () { showAttachmentControls(true); showAttachmentControlsState(true); }"></i>
</div> </div>
<div class="attachmentsControls" <div class="attachmentsControls"
data-bind="visible: showAttachmnetControls() && message() && message().attachments().hasVisible()"> data-bind="visible: showAttachmentControls() && message() && message().attachments().hasVisible()">
<span data-bind="visible: downloadAsZipAllowed"> <span data-bind="visible: downloadAsZipAllowed">
<i class="fontastic iconcolor-red" data-bind="visible: downloadAsZipError"></i> <i class="fontastic iconcolor-red" data-bind="visible: downloadAsZipError"></i>
@ -316,7 +316,7 @@
</span> </span>
<a href="#" class="close" style="margin-right: 5px;" <a href="#" class="close" style="margin-right: 5px;"
data-bind="click: function () { showAttachmnetControls(false); showAttachmnetControlsState(false); }">×</a> data-bind="click: function () { showAttachmentControls(false); showAttachmentControlsState(false); }">×</a>
</div> </div>
</div> </div>