snappymail/dev/View/Admin/Settings/Menu.js

37 lines
789 B
JavaScript
Raw Normal View History

import $ from '$';
import key from 'key';
2019-07-05 03:19:24 +08:00
import { leftPanelDisabled } from 'Common/Globals';
import { KeyState } from 'Common/Enums';
2019-07-05 03:19:24 +08:00
import { view, ViewType, settingsMenuKeysHandler } from 'Knoin/Knoin';
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
@view({
name: 'View/Admin/Settings/Menu',
type: ViewType.Left,
templateID: 'AdminMenu'
})
2019-07-05 03:19:24 +08:00
class MenuSettingsAdminView extends AbstractViewNext {
/**
* @param {?} screen
*/
constructor(screen) {
super();
this.leftPanelDisabled = leftPanelDisabled;
this.menu = screen.menu;
}
link(route) {
return '#/' + route;
}
onBuild(dom) {
2019-03-30 06:45:12 +08:00
key('up, down', KeyState.Settings, settingsMenuKeysHandler($('.b-admin-menu .e-item', dom)));
}
}
2019-07-05 03:19:24 +08:00
export { MenuSettingsAdminView, MenuSettingsAdminView as default };