Completed
Push — master ( 212c12...c53449 )
by Jonathan
20:38 queued 10:31
created

global.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 2
dl 0
loc 11
rs 9.95
c 0
b 0
f 0
1
import { Link } from './link'
2
import { Notify } from './notify'
3
4
export class Global {
5
    constructor() {
6
        this.initLinks()
7
        this.initNotifications()
8
    }
9
10
    initLinks() {
11
        new Link()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Link() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
12
    }
13
14
    initNotifications() {
15
        $('.notification-container').each((index, element) => {
16
            let text = $(element).html()
17
            let color = $(element).data('color')
18
            let placementFrom = $(element).data('placement')
19
            let placementAlign = $(element).data('align')
20
            let animationEnter = $(element).data('animation-enter')
21
            let animationExit = $(element).data('animation-exit')
22
23
            let notify = new Notify()
24
            notify.show(text, color, placementFrom, placementAlign, animationEnter, animationExit)
25
        })
26
    }
27
}