From dc28e44b5e932542d9e97f5f4e0a899bb46dd2e2 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Wed, 13 Nov 2024 14:59:03 +0100 Subject: [PATCH] move creation of angular boostrap __ng2-bootstrap-has-run mark, so it is set after turbo:load too --- frontend/src/app/app.module.ts | 2 ++ frontend/src/main.ts | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index a35c22a3565c..51d140173014 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -414,6 +414,8 @@ export class OpenProjectModule implements DoBootstrap { if (root) { appRef.bootstrap(ApplicationBaseComponent, root); } + + document.body.classList.add('__ng2-bootstrap-has-run'); } private registerCustomElements(injector:Injector) { diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 51373fe7ccad..82f7151eae7f 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -44,10 +44,6 @@ void initializeLocale() initializeGlobalListeners(); // Due to the behaviour of the Edge browser we need to wait for 'DOM ready' - void platformBrowserDynamic() - .bootstrapModule(OpenProjectModule) - .then(() => { - jQuery('body').addClass('__ng2-bootstrap-has-run'); - }); + void platformBrowserDynamic().bootstrapModule(OpenProjectModule); }); });