mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Move Knoin routOff, routOn, routReload & setHash to rl.route.*
This commit is contained in:
parent
03a40f3249
commit
467f615713
17 changed files with 83 additions and 111 deletions
|
|
@ -5,7 +5,7 @@ import { getNotification } from 'Common/Translator';
|
|||
|
||||
import Remote from 'Remote/Admin/Fetch';
|
||||
|
||||
import { view, command, ViewType, routeOff, routeReload } from 'Knoin/Knoin';
|
||||
import { view, command, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
|
|
@ -68,7 +68,7 @@ class LoginAdminView extends AbstractViewNext {
|
|||
(sResult, oData) => {
|
||||
if (StorageResultType.Success === sResult && oData && 'AdminLogin' === oData.Action) {
|
||||
if (oData.Result) {
|
||||
routeReload();
|
||||
rl.route.reload();
|
||||
} else if (oData.ErrorCode) {
|
||||
this.submitRequest(false);
|
||||
this.submitError(getNotification(oData.ErrorCode));
|
||||
|
|
@ -86,7 +86,7 @@ class LoginAdminView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
onShow() {
|
||||
routeOff();
|
||||
rl.route.off();
|
||||
}
|
||||
|
||||
submitForm() {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import Remote from 'Remote/User/Fetch';
|
|||
|
||||
import { ComposeAttachmentModel } from 'Model/ComposeAttachment';
|
||||
|
||||
import { popup, command, isPopupVisible, showScreenPopup, hideScreenPopup, routeOn, routeOff } from 'Knoin/Knoin';
|
||||
import { popup, command, isPopupVisible, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
|
@ -636,7 +636,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
|
||||
this.to.focused(false);
|
||||
|
||||
routeOn();
|
||||
rl.route.on();
|
||||
|
||||
this.resizeObserver.disconnect();
|
||||
}
|
||||
|
|
@ -719,7 +719,7 @@ class ComposePopupView extends AbstractViewNext {
|
|||
* @param {string=} sCustomPlainText = null
|
||||
*/
|
||||
onShow(type, oMessageOrArray, aToEmails, aCcEmails, aBccEmails, sCustomSubject, sCustomPlainText) {
|
||||
routeOff();
|
||||
rl.route.off();
|
||||
|
||||
const ro = this.resizeObserver;
|
||||
ro.observe(ro.compose);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import { EmailModel } from 'Model/Email';
|
|||
import { ContactModel } from 'Model/Contact';
|
||||
import { ContactPropertyModel } from 'Model/ContactProperty';
|
||||
|
||||
import { popup, command, showScreenPopup, hideScreenPopup, routeOn, routeOff } from 'Knoin/Knoin';
|
||||
import { popup, command, showScreenPopup, hideScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
const trim = text => null == text ? "" : (text + "").trim();
|
||||
|
|
@ -633,12 +633,12 @@ class ContactsPopupView extends AbstractViewNext {
|
|||
this.bBackToCompose = undefined === bBackToCompose ? false : !!bBackToCompose;
|
||||
this.sLastComposeFocusedField = undefined === sLastComposeFocusedField ? '' : sLastComposeFocusedField;
|
||||
|
||||
routeOff();
|
||||
rl.route.off();
|
||||
this.reloadContactList(true);
|
||||
}
|
||||
|
||||
onHide() {
|
||||
routeOn();
|
||||
rl.route.on();
|
||||
|
||||
this.currentContact(null);
|
||||
this.emptySelection(true);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import MessageStore from 'Stores/User/Message';
|
|||
import { Capa, KeyState } from 'Common/Enums';
|
||||
import { settings } from 'Common/Links';
|
||||
|
||||
import { showScreenPopup, setHash } from 'Knoin/Knoin';
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
|
@ -60,7 +60,7 @@ class AbstractSystemDropDownUserView extends AbstractViewNext {
|
|||
|
||||
settingsClick() {
|
||||
if (Settings.capa(Capa.Settings)) {
|
||||
setHash(settings());
|
||||
rl.route.setHash(settings());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import * as Local from 'Storage/Client';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { view, command, ViewType, routeOff, showScreenPopup, routeReload } from 'Knoin/Knoin';
|
||||
import { view, command, ViewType, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
import { rootAdmin } from 'Common/Links';
|
||||
|
|
@ -182,7 +182,7 @@ class LoginUserView extends AbstractViewNext {
|
|||
} else if (oData.Admin) {
|
||||
setTimeout(() => location.href = rootAdmin(), 100);
|
||||
} else {
|
||||
routeReload();
|
||||
rl.route.reload();
|
||||
}
|
||||
} else if (oData.ErrorCode) {
|
||||
this.submitRequest(false);
|
||||
|
|
@ -227,7 +227,7 @@ class LoginUserView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
onShow() {
|
||||
routeOff();
|
||||
rl.route.off();
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import SettingsStore from 'Stores/User/Settings';
|
|||
import FolderStore from 'Stores/User/Folder';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
import { view, ViewType, showScreenPopup, setHash } from 'Knoin/Knoin';
|
||||
import { view, ViewType, showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
const Settings = rl.settings;
|
||||
|
|
@ -90,11 +90,10 @@ class FolderListMailBoxUserView extends AbstractViewNext {
|
|||
setFolderHash(folder.fullNameRaw, '');
|
||||
}
|
||||
|
||||
if (starred) {
|
||||
setHash(mailBox(folder.fullNameHash, 1, 'is:flagged'));
|
||||
} else {
|
||||
setHash(mailBox(folder.fullNameHash));
|
||||
}
|
||||
rl.route.setHash(starred
|
||||
? mailBox(folder.fullNameHash, 1, 'is:flagged')
|
||||
: mailBox(folder.fullNameHash)
|
||||
);
|
||||
}
|
||||
|
||||
AppStore.focusedState(Focused.MessageList);
|
||||
|
|
@ -245,7 +244,7 @@ class FolderListMailBoxUserView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
configureFolders() {
|
||||
setHash(settings('folders'));
|
||||
rl.route.setHash(settings('folders'));
|
||||
}
|
||||
|
||||
contactsClick() {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import MessageStore from 'Stores/User/Message';
|
|||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
import { view, command, ViewType, showScreenPopup, setHash, popupVisibility } from 'Knoin/Knoin';
|
||||
import { view, command, ViewType, showScreenPopup, popupVisibility } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
const
|
||||
|
|
@ -235,14 +235,14 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
);
|
||||
|
||||
if ('INBOX' === sFolder) {
|
||||
setHash(mailBox(sFolder, 1));
|
||||
rl.route.setHash(mailBox(sFolder, 1));
|
||||
}
|
||||
|
||||
if (message) {
|
||||
this.selector.selectMessageItem(message);
|
||||
} else {
|
||||
if ('INBOX' !== sFolder) {
|
||||
setHash(mailBox(sFolder, 1));
|
||||
rl.route.setHash(mailBox(sFolder, 1));
|
||||
}
|
||||
|
||||
MessageStore.selectMessageByFolderAndUid(sFolder, sUid);
|
||||
|
|
@ -452,7 +452,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
cancelThreadUid() {
|
||||
setHash(
|
||||
rl.route.setHash(
|
||||
mailBox(
|
||||
FolderStore.currentFolderFullNameHash(),
|
||||
MessageStore.messageListPageBeforeThread(),
|
||||
|
|
@ -690,7 +690,7 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
gotoPage(page) {
|
||||
page && setHash(
|
||||
page && rl.route.setHash(
|
||||
mailBox(
|
||||
FolderStore.currentFolderFullNameHash(),
|
||||
page.value,
|
||||
|
|
@ -704,7 +704,9 @@ class MessageListMailBoxUserView extends AbstractViewNext {
|
|||
if (message && 0 < message.threadsLen()) {
|
||||
MessageStore.messageListPageBeforeThread(MessageStore.messageListPage());
|
||||
|
||||
setHash(mailBox(FolderStore.currentFolderFullNameHash(), 1, MessageStore.messageListSearch(), message.uid));
|
||||
rl.route.setHash(
|
||||
mailBox(FolderStore.currentFolderFullNameHash(), 1, MessageStore.messageListSearch(), message.uid)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { leftPanelDisabled } from 'Common/Globals';
|
|||
import { settings, inbox } from 'Common/Links';
|
||||
import { getFolderInboxName } from 'Common/Cache';
|
||||
|
||||
import { view, ViewType, setHash, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { view, ViewType, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
|
|
@ -40,7 +40,7 @@ class MenuSettingsUserView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
backToMailBoxClick() {
|
||||
setHash(inbox(getFolderInboxName()));
|
||||
rl.route.setHash(inbox(getFolderInboxName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { leftPanelDisabled } from 'Common/Globals';
|
|||
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
|
||||
import { view, ViewType, setHash } from 'Knoin/Knoin';
|
||||
import { view, ViewType } from 'Knoin/Knoin';
|
||||
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
||||
|
||||
@view({
|
||||
|
|
@ -44,7 +44,7 @@ class PaneSettingsUserView extends AbstractViewNext {
|
|||
}
|
||||
|
||||
backToMailBoxClick() {
|
||||
setHash(inbox(getFolderInboxName()));
|
||||
rl.route.setHash(inbox(getFolderInboxName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue