Fix: Changed hint text when the sidebar menu is open or closed.
This commit is contained in:
parent
6e27b9e8cb
commit
e833d4a5dd
4 changed files with 12 additions and 5 deletions
|
|
@ -1,6 +1,10 @@
|
|||
<section (click)="toggleSidebar()">
|
||||
<div class="menu">
|
||||
<img src="./assets/img/sidebar/toggle.svg" alt="" />
|
||||
<p>{{ 'sidebar-toggle.openWorkspace' | translate }}</p>
|
||||
@if (isSidebarOpen) {
|
||||
<p>{{ "sidebar-toggle.openWorkspace" | translate }}</p>
|
||||
} @else {
|
||||
<p>{{ "sidebar-toggle.closeWorkspace" | translate }}</p>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -12,28 +12,29 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||
})
|
||||
export class SidebarToggleComponent {
|
||||
@Input() viewWidth: number = 0;
|
||||
isSidebarOpen: boolean = false;
|
||||
|
||||
constructor(
|
||||
private chatService: ChatService,
|
||||
private toggleBoolean: ToggleBooleanService
|
||||
) {}
|
||||
|
||||
|
||||
/**
|
||||
* Toggles the sidebar visibility and checks the view width.
|
||||
*/
|
||||
toggleSidebar() {
|
||||
this.isSidebarOpen = !this.isSidebarOpen;
|
||||
this.toggleBoolean.isSidebarOpen = !this.toggleBoolean.isSidebarOpen;
|
||||
this.checkViewWidth();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the view width and adjusts sidebar and chat states accordingly.
|
||||
*/
|
||||
checkViewWidth() {
|
||||
if (this.viewWidth <= 1900 && this.chatService.isSecondaryChatOpen) {
|
||||
this.toggleBoolean.isSidebarOpen = true;
|
||||
this.isSidebarOpen = true;
|
||||
}
|
||||
if (this.viewWidth <= 1900) {
|
||||
this.chatService.isSecondaryChatId = '';
|
||||
|
|
|
|||
|
|
@ -166,7 +166,8 @@
|
|||
},
|
||||
|
||||
"sidebar-toggle": {
|
||||
"openWorkspace": "Menü öffnen"
|
||||
"openWorkspace": "Menü öffnen",
|
||||
"closeWorkspace": "Menü schließen"
|
||||
},
|
||||
|
||||
"edit-user-details": {
|
||||
|
|
|
|||
|
|
@ -166,7 +166,8 @@
|
|||
},
|
||||
|
||||
"sidebar-toggle": {
|
||||
"openWorkspace": "Open Menu"
|
||||
"openWorkspace": "Open Menu",
|
||||
"closeWorkspace": "Close Menu"
|
||||
},
|
||||
|
||||
"edit-user-details": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue