2014-09-06 05:44:29 +08:00
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var
|
|
|
|
_ = require('_'),
|
|
|
|
|
2016-05-01 09:07:10 +08:00
|
|
|
Globals = require('Common/Globals'),
|
|
|
|
|
|
|
|
Settings = require('Storage/Settings'),
|
|
|
|
|
2014-09-06 05:44:29 +08:00
|
|
|
kn = require('Knoin/Knoin'),
|
|
|
|
AbstractView = require('Knoin/AbstractView')
|
|
|
|
;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @constructor
|
|
|
|
* @extends AbstractView
|
|
|
|
*/
|
2014-10-18 21:43:44 +08:00
|
|
|
function PaneSettingsUserView()
|
2014-09-06 05:44:29 +08:00
|
|
|
{
|
|
|
|
AbstractView.call(this, 'Right', 'SettingsPane');
|
|
|
|
|
2016-05-01 09:07:10 +08:00
|
|
|
this.mobile = Settings.appSettingsGet('mobile');
|
|
|
|
|
|
|
|
this.leftPanelDisabled = Globals.leftPanelDisabled;
|
|
|
|
|
2014-09-06 05:44:29 +08:00
|
|
|
kn.constructorEnd(this);
|
|
|
|
}
|
|
|
|
|
2014-10-18 21:43:44 +08:00
|
|
|
kn.extendAsViewModel(['View/User/Settings/Pane', 'View/App/Settings/Pane', 'SettingsPaneViewModel'], PaneSettingsUserView);
|
|
|
|
_.extend(PaneSettingsUserView.prototype, AbstractView.prototype);
|
2014-09-06 05:44:29 +08:00
|
|
|
|
2014-10-18 21:43:44 +08:00
|
|
|
PaneSettingsUserView.prototype.onShow = function ()
|
2014-09-06 05:44:29 +08:00
|
|
|
{
|
2015-02-22 06:00:51 +08:00
|
|
|
require('Stores/User/Message').message(null);
|
2014-09-06 05:44:29 +08:00
|
|
|
};
|
|
|
|
|
2016-05-01 09:07:10 +08:00
|
|
|
PaneSettingsUserView.prototype.hideLeft = function (oItem, oEvent)
|
|
|
|
{
|
|
|
|
oEvent.preventDefault();
|
|
|
|
oEvent.stopPropagation();
|
|
|
|
|
|
|
|
Globals.leftPanelDisabled(true);
|
|
|
|
};
|
|
|
|
|
|
|
|
PaneSettingsUserView.prototype.showLeft = function (oItem, oEvent)
|
|
|
|
{
|
|
|
|
oEvent.preventDefault();
|
|
|
|
oEvent.stopPropagation();
|
|
|
|
|
|
|
|
Globals.leftPanelDisabled(false);
|
|
|
|
};
|
|
|
|
|
|
|
|
PaneSettingsUserView.prototype.onBuild = function (oDom)
|
|
|
|
{
|
|
|
|
if (this.mobile)
|
|
|
|
{
|
|
|
|
oDom
|
|
|
|
.on('click', function () {
|
|
|
|
Globals.leftPanelDisabled(true);
|
|
|
|
})
|
|
|
|
;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-10-18 21:43:44 +08:00
|
|
|
PaneSettingsUserView.prototype.backToMailBoxClick = function ()
|
2014-09-06 05:44:29 +08:00
|
|
|
{
|
2015-02-22 06:00:51 +08:00
|
|
|
kn.setHash(require('Common/Links').inbox(
|
2015-02-23 00:35:17 +08:00
|
|
|
require('Common/Cache').getFolderInboxName()));
|
2014-09-06 05:44:29 +08:00
|
|
|
};
|
|
|
|
|
2014-10-18 21:43:44 +08:00
|
|
|
module.exports = PaneSettingsUserView;
|
2014-09-06 05:44:29 +08:00
|
|
|
|
2016-06-28 04:54:38 +08:00
|
|
|
}());
|