From f215d027f9d26cc961ad91579b48013d9f223307 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sun, 20 Aug 2023 01:44:46 -0400 Subject: [PATCH] added draggable aspect in service --- .../left-side-bar/left-side-bar.component.html | 14 +++++++------- .../left-side-bar/left-side-bar.component.ts | 8 ++++++++ src/app/services/navigation.service.ts | 5 +++++ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/app/components/left-side-bar/left-side-bar.component.html b/src/app/components/left-side-bar/left-side-bar.component.html index e12617ff..b7c815ac 100644 --- a/src/app/components/left-side-bar/left-side-bar.component.html +++ b/src/app/components/left-side-bar/left-side-bar.component.html @@ -8,15 +8,15 @@ -
- - +
+
+ + +
-
+
diff --git a/src/app/components/left-side-bar/left-side-bar.component.ts b/src/app/components/left-side-bar/left-side-bar.component.ts index df59e959..376649d0 100644 --- a/src/app/components/left-side-bar/left-side-bar.component.ts +++ b/src/app/components/left-side-bar/left-side-bar.component.ts @@ -35,6 +35,7 @@ export class LeftSideBarComponent implements OnInit, OnDestroy { private accountSub: Subscription; private scheduledSub: Subscription; private notificationSub: Subscription; + private draggableIconMenuSub: Subscription; constructor( private readonly settingsService: SettingsService, @@ -105,7 +106,13 @@ export class LeftSideBarComponent implements OnInit, OnDestroy { } } + iconMenuIsDraggable = false; + ngOnInit() { + this.draggableIconMenuSub = this.navigationService.enableDraggableIconMenu.subscribe(x => { + this.iconMenuIsDraggable = x; + }); + this.accountSub = this.accounts$.subscribe((accounts: AccountInfo[]) => { if (accounts) { //Update and Add @@ -166,6 +173,7 @@ export class LeftSideBarComponent implements OnInit, OnDestroy { this.accountSub.unsubscribe(); this.notificationSub.unsubscribe(); this.scheduledSub.unsubscribe(); + this.draggableIconMenuSub.unsubscribe(); } onDrop(event: CdkDragDrop) { diff --git a/src/app/services/navigation.service.ts b/src/app/services/navigation.service.ts index 72570b78..9d2271fe 100644 --- a/src/app/services/navigation.service.ts +++ b/src/app/services/navigation.service.ts @@ -10,6 +10,7 @@ export class NavigationService { activatedPanelSubject = new BehaviorSubject(new OpenLeftPanelEvent(LeftPanelType.Closed)); activatedMediaSubject: Subject = new Subject(); columnSelectedSubject = new BehaviorSubject(-1); + enableDraggableIconMenu = new BehaviorSubject(false); constructor() { } @@ -19,6 +20,10 @@ export class NavigationService { this.activatedPanelSubject.next(newEvent); } + changeIconMenuState(draggable: boolean) { + this.enableDraggableIconMenu.next(draggable); + } + openPanel(type: LeftPanelType){ const newEvent = new OpenLeftPanelEvent(type); this.activatedPanelSubject.next(newEvent);