mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Cleanup knockout subscribables
This commit is contained in:
parent
5748dea4bc
commit
b2a492bdab
27 changed files with 73 additions and 75 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import ko from 'ko';
|
||||
import { koComputable } from 'External/ko';
|
||||
import { koComputable, addSubscribablesTo } from 'External/ko';
|
||||
|
||||
import { SetSystemFoldersNotification } from 'Common/EnumsUser';
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
import { defaultOptionsAfterRender, addSubscribablesTo } from 'Common/Utils';
|
||||
import { defaultOptionsAfterRender } from 'Common/Utils';
|
||||
import { folderListOptionsBuilder } from 'Common/UtilsUser';
|
||||
import { initOnStartOrLangChange, i18n } from 'Common/Translator';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { getNotification, i18nToNodes } from 'Common/Translator';
|
||||
import { addObservablesTo } from 'Common/Utils';
|
||||
import { addObservablesTo } from 'External/ko';
|
||||
import { delegateRunOnDestroy } from 'Common/UtilsUser';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Scope } from 'Common/Enums';
|
|||
import { moveAction } from 'Common/Globals';
|
||||
import { mailBox, settings } from 'Common/Links';
|
||||
import { setFolderHash } from 'Common/Cache';
|
||||
import { addComputablesTo } from 'Common/Utils';
|
||||
import { addComputablesTo } from 'External/ko';
|
||||
|
||||
import { AppUserStore } from 'Stores/User/App';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
|
|
|
|||
|
|
@ -215,12 +215,15 @@ export class MailMessageView extends AbstractViewRight {
|
|||
},
|
||||
|
||||
fullScreenMode: value => {
|
||||
value && currentMessage() && AppUserStore.focusedState(Scope.MessageView);
|
||||
if (this.oContent) {
|
||||
value ? this.oContent.requestFullscreen() : exitFullscreen();
|
||||
} else {
|
||||
$htmlCL.toggle('rl-message-fullscreen', value);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
showFullInfo: value => Local.set(ClientSideKeyName.MessageHeaderFullInfo, value ? '1' : '0')
|
||||
});
|
||||
|
||||
this.lastReplyAction(Local.get(ClientSideKeyName.LastReplyAction) || ComposeType.Reply);
|
||||
|
|
@ -274,11 +277,6 @@ export class MailMessageView extends AbstractViewRight {
|
|||
}
|
||||
|
||||
onBuild(dom) {
|
||||
this.fullScreenMode.subscribe(value =>
|
||||
value && currentMessage() && AppUserStore.focusedState(Scope.MessageView));
|
||||
|
||||
this.showFullInfo.subscribe(value => Local.set(ClientSideKeyName.MessageHeaderFullInfo, value ? '1' : '0'));
|
||||
|
||||
const el = dom.querySelector('.b-content');
|
||||
this.oContent = initFullscreen(el, () => this.fullScreenMode(getFullscreenElement() === el));
|
||||
|
||||
|
|
@ -334,7 +332,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
}
|
||||
});
|
||||
|
||||
AppUserStore.focusedState.subscribe((value) => {
|
||||
AppUserStore.focusedState.subscribe(value => {
|
||||
if (Scope.MessageView !== value) {
|
||||
this.scrollMessageToTop();
|
||||
this.scrollMessageToLeft();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue