snappymail/dev/View/Popup/WelcomePage.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
var
_ = require('_'),
ko = require('ko'),
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
Promises = require('Promises/User/Ajax'),
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
kn = require('Knoin/Knoin'),
AbstractView = require('Knoin/AbstractView');
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
/**
* @constructor
* @extends AbstractView
*/
function WelcomePagePopupView()
{
AbstractView.call(this, 'Popups', 'PopupsWelcomePage');
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
this.welcomePageURL = ko.observable('');
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
this.closeFocused = ko.observable(false);
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
kn.constructorEnd(this);
}
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
kn.extendAsViewModel(['View/Popup/WelcomePage', 'WelcomePagePopupViewModel'], WelcomePagePopupView);
_.extend(WelcomePagePopupView.prototype, AbstractView.prototype);
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
WelcomePagePopupView.prototype.clearPopup = function()
{
this.welcomePageURL('');
this.closeFocused(false);
};
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
/**
* @param {string} sUrl
* @returns {void}
*/
WelcomePagePopupView.prototype.onShow = function(sUrl)
{
this.clearPopup();
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
this.welcomePageURL(sUrl);
};
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
WelcomePagePopupView.prototype.onShowWithDelay = function()
{
this.closeFocused(true);
};
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
WelcomePagePopupView.prototype.onHide = function()
{
Promises.welcomeClose();
};
2015-04-10 06:05:49 +08:00
2016-06-30 08:02:45 +08:00
module.exports = WelcomePagePopupView;