snappymail/dev/View/Popup/WelcomePage.js

46 lines
780 B
JavaScript
Raw Normal View History

import ko from 'ko';
2015-04-10 06:05:49 +08:00
import Promises from 'Promises/User/Ajax';
2015-04-10 06:05:49 +08:00
2019-07-05 03:19:24 +08:00
import { popup } from 'Knoin/Knoin';
import { AbstractViewNext } from 'Knoin/AbstractViewNext';
2015-04-10 06:05:49 +08:00
2016-09-10 06:38:16 +08:00
@popup({
name: 'View/Popup/WelcomePage',
templateID: 'PopupsWelcomePage'
})
2019-07-05 03:19:24 +08:00
class WelcomePagePopupView extends AbstractViewNext {
constructor() {
super();
2015-04-10 06:05:49 +08:00
this.welcomePageURL = ko.observable('');
2015-04-10 06:05:49 +08:00
this.closeFocused = ko.observable(false);
}
2015-04-10 06:05:49 +08:00
clearPopup() {
this.welcomePageURL('');
this.closeFocused(false);
}
2015-04-10 06:05:49 +08:00
/**
* @param {string} sUrl
* @returns {void}
*/
onShow(sUrl) {
this.clearPopup();
2015-04-10 06:05:49 +08:00
this.welcomePageURL(sUrl);
}
2015-04-10 06:05:49 +08:00
onShowWithDelay() {
this.closeFocused(true);
}
2015-04-10 06:05:49 +08:00
onHide() {
Promises.welcomeClose();
}
}
2015-04-10 06:05:49 +08:00
2019-07-05 03:19:24 +08:00
export { WelcomePagePopupView, WelcomePagePopupView as default };