mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-23 15:30:34 -04:00
Configure Animation Module (#1504)
* Configure Animation Module Configure the Animation Module of Angular to disable animation on older iOS devices (<14) where it causes animate not defined errors. * Simplified disableAnimations Removed the regex iOS version check as it seemed to return false on iOS 12.5.5 meaning that the `!('animate' in document.documentElement)` did the job already. This also allows users to enable the experimental feature Web Animations on iOS 12.5.5 to have them enabled again. as note; navigator.userAgent returned the following on an iPad iOS 12.5.5 `Mozilla/5.0 (iPad; CPU OS 12_5_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1` * added console output on disabled Added console.error if Web Animations have been disabled due to the browser not supporting this.
This commit is contained in:
parent
dae481482e
commit
00159378ce
@ -14,7 +14,9 @@ import { SidenavModule } from './sidenav/sidenav.module';
|
|||||||
import { NavModule } from './nav/nav.module';
|
import { NavModule } from './nav/nav.module';
|
||||||
|
|
||||||
|
|
||||||
|
// Disable Web Animations if the user's browser (such as iOS 12.5.5) does not support this.
|
||||||
|
const disableAnimations = !('animate' in document.documentElement);
|
||||||
|
if (disableAnimations) console.error("Web Animations have been disabled as your current browser does not support this.");
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -24,7 +26,7 @@ import { NavModule } from './nav/nav.module';
|
|||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule.withConfig({ disableAnimations }),
|
||||||
SidenavModule,
|
SidenavModule,
|
||||||
NavModule,
|
NavModule,
|
||||||
ToastrModule.forRoot({
|
ToastrModule.forRoot({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user