1
- // TODO: This file was created by bulk-decaffeinate.
2
- // Sanity-check the conversion and remove this comment.
3
- /*
4
- * decaffeinate suggestions:
5
- * DS206: Consider reworking classes to avoid initClass
6
- * DS207: Consider shorter variations of null checks
7
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
8
- */
9
1
app . views . Notif = class Notif extends app . View {
10
- static initClass ( ) {
11
- this . className = "_notif" ;
12
- this . activeClass = "_in" ;
13
- this . attributes = { role : "alert" } ;
2
+ static className = "_notif" ;
3
+ static activeClass = "_in" ;
4
+ static attributes = { role : "alert" } ;
14
5
15
- this . defaultOptions = { autoHide : 15000 } ;
6
+ static defaultOptions = { autoHide : 15000 } ;
16
7
17
- this . events = { click : "onClick" } ;
18
- }
8
+ static events = { click : "onClick" } ;
19
9
20
10
constructor ( type , options ) {
21
11
super ( ) ;
22
12
this . type = type ;
23
13
this . options = $ . extend ( { } , this . constructor . defaultOptions , options || { } ) ;
14
+ this . init0 ( ) ; // needs this.options
15
+ this . refreshElements ( ) ;
24
16
}
25
17
26
- init ( ) {
18
+ init0 ( ) {
27
19
this . show ( ) ;
28
20
}
29
21
@@ -55,7 +47,7 @@ app.views.Notif = class Notif extends app.View {
55
47
}
56
48
57
49
position ( ) {
58
- const notifications = $$ ( `.${ app . views . Notif . className } ` ) ;
50
+ const notifications = $$ ( `.${ Notif . className } ` ) ;
59
51
if ( notifications . length ) {
60
52
const lastNotif = notifications [ notifications . length - 1 ] ;
61
53
this . el . style . top =
@@ -77,4 +69,3 @@ app.views.Notif = class Notif extends app.View {
77
69
}
78
70
}
79
71
} ;
80
- app . views . Notif . initClass ( ) ;
0 commit comments