-
-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathSuccessMessage.js
More file actions
49 lines (41 loc) · 1.37 KB
/
SuccessMessage.js
File metadata and controls
49 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Project Name : Visual Python
* Description : GUI-based Python code generator
* File Name : SuccessMessage.js
* Author : Black Logic
* Note : SuccessMessage
* License : GNU GPLv3 with Visual Python special exception
* Date : 2021. 11. 18
* Change Date :
*/
//============================================================================
// [CLASS] SuccessMessage
//============================================================================
define([
'text!vp_base/html/component/successMessage.html!strip',
'css!vp_base/css/component/successMessage.css',
'vp_base/js/com/component/Component'
], function(msgHtml, msgCss, Component) {
/**
* SuccessMessage
*/
class SuccessMessage extends Component {
constructor(title, timeout=1500) {
super($('#header'), { title: title, timeout: timeout });
}
template() {
return msgHtml;
}
render() {
super.render();
// set title
$(this.wrapSelector('.vp-successMessage-title')).text(this.state.title);
let that = this;
// remove after timeout
setTimeout( function() {
$(that.wrapSelector()).remove();
}, this.state.timeout);
}
}
return SuccessMessage;
});