snappymail/dev/View/User/Settings/Pane.js

52 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-07-05 03:19:24 +08:00
import { inbox } from 'Common/Links';
import { getFolderInboxName } from 'Common/Cache';
import { leftPanelDisabled } from 'Common/Globals';
import MessageStore from 'Stores/User/Message';
import { view, ViewType } from 'Knoin/Knoin';
2019-07-05 03:19:24 +08:00
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
2016-05-01 09:07:10 +08:00
@view({
name: 'View/User/Settings/Pane',
type: ViewType.Right,
templateID: 'SettingsPane'
})
2019-07-05 03:19:24 +08:00
class PaneSettingsUserView extends AbstractViewNext {
constructor() {
super();
2016-05-01 09:07:10 +08:00
this.mobile = rl.settings.app('mobile');
this.leftPanelDisabled = leftPanelDisabled;
}
2016-05-01 09:07:10 +08:00
onShow() {
MessageStore.message(null);
}
hideLeft(item, event) {
event.preventDefault();
event.stopPropagation();
leftPanelDisabled(true);
}
showLeft(item, event) {
event.preventDefault();
event.stopPropagation();
2016-05-01 09:07:10 +08:00
leftPanelDisabled(false);
}
2016-05-01 09:07:10 +08:00
onBuild(dom) {
this.mobile && dom.addEventListener('click', () => leftPanelDisabled(true));
2016-06-30 08:02:45 +08:00
}
backToMailBoxClick() {
rl.route.setHash(inbox(getFolderInboxName()));
}
}
2019-07-05 03:19:24 +08:00
export { PaneSettingsUserView, PaneSettingsUserView as default };