Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use correct import of screenfull

Oliver Günther6cabb78aabf0
diff --git a/frontend/src/app/components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component.ts b/frontend/src/app/components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component.ts
index 9984e1ec475..48f542b2f0c 100644
--- a/frontend/src/app/components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component.ts
+++ b/frontend/src/app/components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component.ts
@@ -30,8 +30,10 @@ import {AbstractWorkPackageButtonComponent} from '../wp-buttons.module';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from '@angular/core';
import {I18nService} from 'core-app/modules/common/i18n/i18n.service';
-const screenfull:any = require('screenfull/dist/screenfull.js');
+import * as sfimport from "screenfull";
+import {Screenfull} from "screenfull";
+const screenfull:Screenfull = sfimport as any;
export const zenModeComponentSelector = 'zen-mode-toggle-button';
@Component({
@@ -57,6 +59,7 @@ export class ZenModeButtonComponent extends AbstractWorkPackageButtonComponent {
this.deactivateLabel = I18n.t('js.zen_mode.button_deactivate');
let self = this;
+
if (screenfull.enabled) {
screenfull.onchange(function() {
// This event might get triggered several times for once leaving
diff --git a/frontend/src/app/init-vendors.ts b/frontend/src/app/init-vendors.ts
index 65e7d21c31b..14fe26076b5 100644
--- a/frontend/src/app/init-vendors.ts
+++ b/frontend/src/app/init-vendors.ts
@@ -79,3 +79,4 @@ require("expose-loader?I18n!core-vendor/i18n");
// Localization for fullcalendar
require("@fullcalendar/core/locales-all");
+