diff --git a/frontend/src/app/core/browser/device.service.ts b/frontend/src/app/core/browser/device.service.ts index f89c9167aa..418328a579 100644 --- a/frontend/src/app/core/browser/device.service.ts +++ b/frontend/src/app/core/browser/device.service.ts @@ -3,8 +3,13 @@ import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class DeviceService { public mobileWidthTreshold = 680; + public tabletWidthTreshold = 1249; public get isMobile():boolean { return (window.innerWidth < this.mobileWidthTreshold); } + + public get isTablet():boolean { + return (window.innerWidth < this.tabletWidthTreshold); + } } diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts index 4bf2af7b76..8e90f22427 100644 --- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts +++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller.ts @@ -39,6 +39,7 @@ import { InAppNotification } from 'core-app/features/in-app-notifications/store/ import { InAppNotificationsService } from 'core-app/features/in-app-notifications/store/in-app-notifications.service'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; +import { DeviceService } from 'core-app/core/browser/device.service'; @Directive() export class ActivityPanelBaseController extends UntilDestroyedMixin implements OnInit { @@ -74,6 +75,7 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements readonly $transition:Transition, readonly wpActivity:WorkPackagesActivityService, readonly ianService:InAppNotificationsService, + readonly deviceService:DeviceService, ) { super(); @@ -145,7 +147,7 @@ export class ActivityPanelBaseController extends UntilDestroyedMixin implements protected scrollToUnreadNotification():void { // scroll to the unread notification only if there is no deep link - if (window.location.href.indexOf('activity#') > -1) { + if (window.location.href.indexOf('activity#') > -1 || this.deviceService.isTablet) { return; } const unreadNotifications = document.querySelectorAll('.comments-number--bubble');