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