mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-10 08:48:03 +08:00
c7054ff56c
There this works
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import { KeyState } from 'Common/Enums';
|
|
import { leftPanelDisabled } from 'Common/Globals';
|
|
import { settings, inbox } from 'Common/Links';
|
|
import { getFolderInboxName } from 'Common/Cache';
|
|
|
|
import { view, ViewType, settingsMenuKeysHandler } from 'Knoin/Knoin';
|
|
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
|
|
|
|
@view({
|
|
name: 'View/User/Settings/Menu',
|
|
type: ViewType.Left,
|
|
templateID: 'SettingsMenu'
|
|
})
|
|
class MenuSettingsUserView extends AbstractViewNext {
|
|
/**
|
|
* @param {Object} screen
|
|
*/
|
|
constructor(screen) {
|
|
super();
|
|
|
|
this.leftPanelDisabled = leftPanelDisabled;
|
|
|
|
this.mobile = rl.settings.app('mobile');
|
|
|
|
this.menu = screen.menu;
|
|
}
|
|
|
|
onBuild(dom) {
|
|
if (this.mobile) {
|
|
dom.addEventListener('click', event =>
|
|
event.target.closestWithin('.b-settings-menu .e-item.selectable', dom) && leftPanelDisabled(true)
|
|
);
|
|
}
|
|
|
|
shortcuts.add('arrowup,arrowdown', '', KeyState.Settings,
|
|
settingsMenuKeysHandler(dom.querySelectorAll('.b-settings-menu .e-item')));
|
|
}
|
|
|
|
link(route) {
|
|
return settings(route);
|
|
}
|
|
|
|
backToMailBoxClick() {
|
|
rl.route.setHash(inbox(getFolderInboxName()));
|
|
}
|
|
}
|
|
|
|
export { MenuSettingsUserView, MenuSettingsUserView as default };
|