@@ -91,7 +91,6 @@ var FlasherFactory = (function () {
91
91
var notification = envelope . notification ;
92
92
var nOptions = notification . options || { } ;
93
93
var options = Array . isArray ( nOptions ) ? this . options : Object . assign ( { } , this . options , nOptions ) ;
94
- this . applyDarkMode ( ) ;
95
94
var onContainerReady = function ( ) {
96
95
var container = _this . createContainer ( options ) ;
97
96
_this . addToContainer ( container , envelope , options ) ;
@@ -104,6 +103,7 @@ var FlasherFactory = (function () {
104
103
} ;
105
104
FlasherFactory . prototype . renderOptions = function ( options ) {
106
105
this . options = Object . assign ( { } , this . options , options ) ;
106
+ this . applyDarkMode ( ) ;
107
107
} ;
108
108
FlasherFactory . prototype . createContainer = function ( options ) {
109
109
var containerSelector = ".fl-main-container[data-position=\"" . concat ( options . position , "\"]" ) ;
@@ -183,6 +183,9 @@ var FlasherFactory = (function () {
183
183
template . addEventListener ( 'mouseover' , function ( ) { return clearInterval ( progressInterval ) ; } ) ;
184
184
} ;
185
185
FlasherFactory . prototype . applyDarkMode = function ( ) {
186
+ if ( document . body . classList . contains ( 'fl-dark-mode' ) ) {
187
+ return ;
188
+ }
186
189
var _a = [ ] . concat ( this . options . darkMode ) , mode = _a [ 0 ] , _b = _a [ 1 ] , className = _b === void 0 ? '.dark' : _b ;
187
190
var css = '.fl-main-container .fl-container.fl-flasher {background-color: rgb(15, 23, 42);color: rgb(255, 255, 255);}' ;
188
191
css = 'media' === mode
@@ -192,6 +195,7 @@ var FlasherFactory = (function () {
192
195
style . type = 'text/css' ;
193
196
style . appendChild ( document . createTextNode ( css ) ) ;
194
197
document . head . appendChild ( style ) ;
198
+ document . body . classList . add ( 'fl-dark-mode' ) ;
195
199
} ;
196
200
FlasherFactory . prototype . stringToHTML = function ( str ) {
197
201
var support = ( function ( ) {
0 commit comments