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

hide menu on initialization for tablet mode

bsatarnejadee5260a398be
diff --git a/frontend/src/app/core/main-menu/main-menu-toggle.service.ts b/frontend/src/app/core/main-menu/main-menu-toggle.service.ts
index 45b048a52a5..6eafa27780f 100644
--- a/frontend/src/app/core/main-menu/main-menu-toggle.service.ts
+++ b/frontend/src/app/core/main-menu/main-menu-toggle.service.ts
@@ -93,8 +93,8 @@ export class MainMenuToggleService {
this.saveWidth(this.defaultWidth);
}
- // mobile version default: hide menu on initialization
- this.closeWhenOnMobile();
+ // tablet version default: hide menu on initialization
+ this.closeWhenOnTablet();
}
// click on arrow or hamburger icon
@@ -105,7 +105,7 @@ export class MainMenuToggleService {
}
if (!this.showNavigation) { // sidebar is hidden -> show menu
- if (this.deviceService.isMobile) { // mobile version
+ if (this.deviceService.isTablet) { // tablet version
this.setWidth(window.innerWidth);
} else { // desktop version
const savedWidth = parseInt(window.OpenProject.guardedLocalStorage(this.localStorageKey) as string);
@@ -131,8 +131,8 @@ export class MainMenuToggleService {
jQuery('.searchable-menu--search-input').blur();
}
- public closeWhenOnMobile():void {
- if (this.deviceService.isMobile) {
+ public closeWhenOnTablet():void {
+ if (this.deviceService.isTablet) {
this.closeMenu();
window.OpenProject.guardedLocalStorage(this.localStorageStateKey, 'false');
}
@@ -147,7 +147,7 @@ export class MainMenuToggleService {
public setWidth(width?:any):void {
if (width !== undefined) {
// Leave a minimum amount of space for space for the content
- const maxMenuWidth = this.deviceService.isMobile ? window.innerWidth - 120 : window.innerWidth - 520;
+ const maxMenuWidth = this.deviceService.isTablet ? window.innerWidth - 120 : window.innerWidth - 520;
if (width > maxMenuWidth) {
this.elementWidth = maxMenuWidth;
} else {