@@ -7,13 +7,13 @@ import {defaults} from './defaults';
7
7
/* Render React component */
8
8
function renderToast ( text , type , timeout , color ) {
9
9
let target = document . getElementById ( defaults . wrapperId ) ;
10
- ReactDOM . render ( < Toast text = { text } timeout = { timeout } type = { type } color = { color } /> , target ) ;
10
+ ReactDOM . render ( < Toast text = { text } timeout = { timeout } type = { type } color = { color } /> , target ) ;
11
11
}
12
12
13
13
/* Unmount React component */
14
14
function hide ( ) {
15
15
let target = document . getElementById ( defaults . wrapperId ) ;
16
- ReactDOM . unmountComponentAtNode ( target ) ;
16
+ ReactDOM . unmountComponentAtNode ( target ) ;
17
17
}
18
18
19
19
@@ -32,24 +32,24 @@ function hide() {
32
32
* }
33
33
*/
34
34
function show ( text , type , timeout , color ) {
35
- if ( ! document . getElementById ( defaults . wrapperId ) . hasChildNodes ( ) ) {
35
+ if ( ! document . getElementById ( defaults . wrapperId ) . hasChildNodes ( ) ) {
36
36
// Use default timeout if not set.
37
- let renderTimeout = timeout || defaults . timeout ;
37
+ let renderTimeout = timeout || defaults . timeout ;
38
38
39
- // Render Component with Props.
40
- renderToast ( text , type , renderTimeout , color ) ;
39
+ // Render Component with Props.
40
+ renderToast ( text , type , renderTimeout , color ) ;
41
41
42
- if ( renderTimeout === - 1 ) {
43
- return false ;
44
- }
42
+ if ( renderTimeout === - 1 ) {
43
+ return false ;
44
+ }
45
45
46
- // Unmount react component after the animation finished.
47
- setTimeout ( function ( ) {
48
- hide ( ) ;
49
- } , renderTimeout + defaults . animationDuration ) ;
46
+ // Unmount react component after the animation finished.
47
+ setTimeout ( function ( ) {
48
+ hide ( ) ;
49
+ } , renderTimeout + defaults . animationDuration ) ;
50
50
51
51
return true ;
52
- }
52
+ }
53
53
54
54
return false ;
55
55
}
@@ -110,7 +110,7 @@ function createShowQueue(initialRecallDelay = 500, recallDelayIncrement = 500) {
110
110
111
111
/* Export notification functions */
112
112
export let notify = {
113
- show,
113
+ show,
114
114
hide,
115
115
createShowQueue
116
116
} ;
0 commit comments