Temporary disable automatic open/close sidebar
[src/xds/xds-agent.git] / webapp / src / app / @theme / layouts / xds / xds.layout.ts
index b362fff..f37d3ac 100644 (file)
@@ -80,14 +80,15 @@ export class XdsLayoutComponent implements OnDestroy {
     this.sidebarService.onExpand().subscribe(s => s.tag === 'menu-sidebar' && (this.sidebarCompact = false));
     this.menuService.onSubmenuToggle().subscribe(i => i.item && i.item.expanded && (this.sidebarCompact = false));
 
+    // FIXME: bug flicking menu - disable it for now
+    /*
     // Automatically expand sidebar on mouse over
     this._mouseEnterStream.flatMap(e => {
       return Observable
         .of(e)
         .delay(100)
         .takeUntil(this._mouseLeaveStream);
-    })
-      .subscribe(e => {
+      }).subscribe(e => {
         if (this.sidebarPinned || !this.sidebarCompact) {
           return;
         }
@@ -101,14 +102,14 @@ export class XdsLayoutComponent implements OnDestroy {
         .of(e)
         .delay(100)
         .takeUntil(this._mouseEnterStream);
-    })
-      .subscribe(e => {
+      }).subscribe(e => {
         if (this.sidebarPinned || this.sidebarCompact) {
           return;
         }
         // this._mouseEnterStream.emit(null);
         this.sidebarService.toggle(true, 'menu-sidebar');
       });
+      */
   }
 
   ngOnDestroy() {
@@ -118,14 +119,20 @@ export class XdsLayoutComponent implements OnDestroy {
   }
 
   onMouseEnter($event) {
-    this._mouseEnterStream.emit($event);
+    // FIXME: bug flicking menu - disable it for now
+    // this._mouseEnterStream.emit($event);
   }
 
   onMouseLeave($event) {
-    this._mouseLeaveStream.emit($event);
+    // FIXME: bug flicking menu - disable it for now
+    // this._mouseLeaveStream.emit($event);
   }
 
   pinSidebar() {
     this.sidebarPinned = !this.sidebarPinned;
   }
+
+  closeSidebar() {
+    this.sidebarService.toggle(true, 'menu-sidebar');
+  }
 }