File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,8 +198,8 @@ class Framework7 extends Framework7Class {
198198 const app = this ;
199199 const html = document . querySelector ( 'html' ) ;
200200 if ( app . mq . dark && app . mq . light ) {
201- app . mq . dark . addListener ( app . colorSchemeListener ) ;
202- app . mq . light . addListener ( app . colorSchemeListener ) ;
201+ app . mq . dark . addEventListener ( "change" , app . colorSchemeListener ) ;
202+ app . mq . light . addEventListener ( "change" , app . colorSchemeListener ) ;
203203 }
204204 if ( app . mq . dark && app . mq . dark . matches ) {
205205 html . classList . add ( 'dark' ) ;
@@ -216,8 +216,8 @@ class Framework7 extends Framework7Class {
216216 const window = getWindow ( ) ;
217217 if ( ! window . matchMedia ) return ;
218218 const app = this ;
219- if ( app . mq . dark ) app . mq . dark . removeListener ( app . colorSchemeListener ) ;
220- if ( app . mq . light ) app . mq . light . removeListener ( app . colorSchemeListener ) ;
219+ if ( app . mq . dark ) app . mq . dark . removeEventListener ( "change" , app . colorSchemeListener ) ;
220+ if ( app . mq . light ) app . mq . light . removeEventListener ( "change" , app . colorSchemeListener ) ;
221221 }
222222
223223 setDarkMode ( mode ) {
You can’t perform that action at this time.
0 commit comments