mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 16:37:02 +03: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,
|
'LastReplyAction': 6,
|
||||||
'LastSignMe': 7,
|
'LastSignMe': 7,
|
||||||
'ComposeLastIdentityID': 8,
|
'ComposeLastIdentityID': 8,
|
||||||
'MessageHeaderFullInfo': 9
|
'MessageHeaderFullInfo': 9,
|
||||||
|
'MessageAttachmnetControls': 10
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,10 @@ class MessageViewMailBoxUserView extends AbstractViewNext
|
||||||
|
|
||||||
this.showAttachmnetControls = ko.observable(false);
|
this.showAttachmnetControls = ko.observable(false);
|
||||||
|
|
||||||
|
this.showAttachmnetControlsState = (v) => {
|
||||||
|
Local.set(ClientSideKeyName.MessageAttachmnetControls, !!v);
|
||||||
|
};
|
||||||
|
|
||||||
this.allowAttachmnetControls = ko.computed(
|
this.allowAttachmnetControls = ko.computed(
|
||||||
() => 0 < this.attachmentsActions().length && Settings.capa(Capa.AttachmentsActions)
|
() => 0 < this.attachmentsActions().length && Settings.capa(Capa.AttachmentsActions)
|
||||||
);
|
);
|
||||||
|
|
@ -320,6 +324,12 @@ class MessageViewMailBoxUserView extends AbstractViewNext
|
||||||
if (message)
|
if (message)
|
||||||
{
|
{
|
||||||
this.showAttachmnetControls(false);
|
this.showAttachmnetControls(false);
|
||||||
|
if (Local.get(ClientSideKeyName.MessageAttachmnetControls))
|
||||||
|
{
|
||||||
|
_.delay(() => {
|
||||||
|
this.showAttachmnetControls(true);
|
||||||
|
}, Magics.Time50ms);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.viewHash !== message.hash)
|
if (this.viewHash !== message.hash)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,7 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</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>
|
||||||
|
|
||||||
<div class="attachmentsControls"
|
<div class="attachmentsControls"
|
||||||
|
|
@ -430,7 +430,7 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<button type="button" class="close" style="margin-right: 5px;"
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue