fix cannot load page when some old browsers don't support addEventListener for MediaQueryList (#588)
This commit is contained in:
parent
836b39ed3d
commit
2a3748d2d4
|
@ -14,7 +14,10 @@
|
||||||
var browserSupportStorage = browserFeatures.localStroage || browserFeatures.cookies;
|
var browserSupportStorage = browserFeatures.localStroage || browserFeatures.cookies;
|
||||||
var browserSupportAppCache = !!$window.applicationCache;
|
var browserSupportAppCache = !!$window.applicationCache;
|
||||||
var browserSupportMatchMedia = !!$window.matchMedia;
|
var browserSupportMatchMedia = !!$window.matchMedia;
|
||||||
var browserSupportDarkMode = browserSupportMatchMedia && $window.matchMedia('(prefers-color-scheme: dark)') && $window.matchMedia('(prefers-color-scheme: dark)').media !== 'not all';
|
var browserSupportDarkMode = browserSupportMatchMedia
|
||||||
|
&& $window.matchMedia('(prefers-color-scheme: dark)')
|
||||||
|
&& $window.matchMedia('(prefers-color-scheme: dark)').media !== 'not all'
|
||||||
|
&& angular.isFunction($window.matchMedia('(prefers-color-scheme: dark)').addEventListener);
|
||||||
|
|
||||||
var onAppCacheUpdatedCallbacks = [];
|
var onAppCacheUpdatedCallbacks = [];
|
||||||
var onFirstVisitCallbacks = [];
|
var onFirstVisitCallbacks = [];
|
||||||
|
|
Reference in a new issue