mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-23 14:26:18 +08:00
Save showAttachmnetControls status to local storage (#1502)
This commit is contained in:
parent
650b655539
commit
230624b60c
3 changed files with 14 additions and 3 deletions
|
@ -210,7 +210,8 @@ export const ClientSideKeyName = {
|
|||
'LastReplyAction': 6,
|
||||
'LastSignMe': 7,
|
||||
'ComposeLastIdentityID': 8,
|
||||
'MessageHeaderFullInfo': 9
|
||||
'MessageHeaderFullInfo': 9,
|
||||
'MessageAttachmnetControls': 10
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -132,6 +132,10 @@ class MessageViewMailBoxUserView extends AbstractViewNext
|
|||
|
||||
this.showAttachmnetControls = ko.observable(false);
|
||||
|
||||
this.showAttachmnetControlsState = (v) => {
|
||||
Local.set(ClientSideKeyName.MessageAttachmnetControls, !!v);
|
||||
};
|
||||
|
||||
this.allowAttachmnetControls = ko.computed(
|
||||
() => 0 < this.attachmentsActions().length && Settings.capa(Capa.AttachmentsActions)
|
||||
);
|
||||
|
@ -320,6 +324,12 @@ class MessageViewMailBoxUserView extends AbstractViewNext
|
|||
if (message)
|
||||
{
|
||||
this.showAttachmnetControls(false);
|
||||
if (Local.get(ClientSideKeyName.MessageAttachmnetControls))
|
||||
{
|
||||
_.delay(() => {
|
||||
this.showAttachmnetControls(true);
|
||||
}, Magics.Time50ms);
|
||||
}
|
||||
|
||||
if (this.viewHash !== message.hash)
|
||||
{
|
||||
|
|
|
@ -389,7 +389,7 @@
|
|||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<i class="icon-cog controls-handle" data-bind="visible: allowAttachmnetControls() && !showAttachmnetControls(), click: function () { showAttachmnetControls(true) }"></i>
|
||||
<i class="icon-cog controls-handle" data-bind="visible: allowAttachmnetControls() && !showAttachmnetControls(), click: function () { showAttachmnetControls(true); showAttachmnetControlsState(true); }"></i>
|
||||
</div>
|
||||
|
||||
<div class="attachmentsControls"
|
||||
|
@ -430,7 +430,7 @@
|
|||
</span>
|
||||
|
||||
<button type="button" class="close" style="margin-right: 5px;"
|
||||
data-bind="click: function () { showAttachmnetControls(false); }">×</button>
|
||||
data-bind="click: function () { showAttachmnetControls(false); showAttachmnetControlsState(false); }">×</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue