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

61 lines
1.1 KiB
JavaScript
Raw Normal View History

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