aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-06-19 17:09:54 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-06-19 17:09:56 +0200
commit2c41aae53904c26bc3b4975ab96db3d5ff8413ad (patch)
treeec5eb9d0e8c5f9ea801c6de04db2c7ee40300e30
parent48739a930ceb0c6a4b843471750da70db2052890 (diff)
Temporary disable automatic open/close sidebar
Auto open/close logic in xds.layout.ts file seems buggy resulting to a flicking sidebar. So disable this feature for now. Change-Id: I1df6cd0af9f1b60cd54b48d763a870ef69a5fbe9 Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r--webapp/src/app/@theme/layouts/xds/xds.layout.html12
-rw-r--r--webapp/src/app/@theme/layouts/xds/xds.layout.ts19
-rw-r--r--webapp/src/app/pages/targets/target-add-modal/target-add-modal.component.html2
3 files changed, 26 insertions, 7 deletions
diff --git a/webapp/src/app/@theme/layouts/xds/xds.layout.html b/webapp/src/app/@theme/layouts/xds/xds.layout.html
index ee0a80b..ffbe80c 100644
--- a/webapp/src/app/@theme/layouts/xds/xds.layout.html
+++ b/webapp/src/app/@theme/layouts/xds/xds.layout.html
@@ -9,17 +9,29 @@
<nb-sidebar-header (click)="pinSidebar()">
<!-- left sidebar -->
+ <!-- FIXME - bug flicking menu
<nb-actions *ngIf="sidebar.id === 'left'" size="small" class="header-container right">
<nb-action id="pin-sidebar" [icon]="(!sidebarPinned || sidebarCompact) ? 'fa fa-angle-double-right':'fa fa-angle-double-left'"
[ngbTooltip]="sidebarPinned ? 'Undock the sidebar so it is hidden when no being focused':'Dock the sidebar so you can always see it'" placement="bottom">
</nb-action>
</nb-actions>
+ -->
+ <nb-actions *ngIf="sidebar.id === 'left'" size="small" class="header-container right">
+ <nb-action id="pin-sidebar" icon="fa fa-angle-double-left" placement="bottom" (click)="closeSidebar()">
+ </nb-action>
+ </nb-actions>
<!-- right sidebar -->
+ <!-- FIXME - bug flicking menu
<nb-actions *ngIf="sidebar.id === 'right'" size="small" class="header-container left">
<nb-action id="pin-sidebar" [icon]="(!sidebarPinned || sidebarCompact) ? 'fa fa-angle-double-left':'fa fa-angle-double-right'"
[ngbTooltip]="sidebarPinned ? 'Undock the sidebar so it is hidden when no being focused':'Dock the sidebar so you can always see it'" placement="bottom">
</nb-action>
</nb-actions>
+ -->
+ <nb-actions *ngIf="sidebar.id === 'right'" size="small" class="header-container left">
+ <nb-action id="pin-sidebar" icon="fa fa-angle-double-right" placement="bottom" (click)="closeSidebar()">
+ </nb-action>
+ </nb-actions>
</nb-sidebar-header>
<ng-content select="nb-menu"></ng-content>
diff --git a/webapp/src/app/@theme/layouts/xds/xds.layout.ts b/webapp/src/app/@theme/layouts/xds/xds.layout.ts
index b362fff..f37d3ac 100644
--- a/webapp/src/app/@theme/layouts/xds/xds.layout.ts
+++ b/webapp/src/app/@theme/layouts/xds/xds.layout.ts
@@ -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');
+ }
}
diff --git a/webapp/src/app/pages/targets/target-add-modal/target-add-modal.component.html b/webapp/src/app/pages/targets/target-add-modal/target-add-modal.component.html
index 84424b4..7a16330 100644
--- a/webapp/src/app/pages/targets/target-add-modal/target-add-modal.component.html
+++ b/webapp/src/app/pages/targets/target-add-modal/target-add-modal.component.html
@@ -40,7 +40,7 @@
<div class="col-12">
<div class="offset-sm-4 col-sm-6">
<button class="btn btn-md btn-secondary" (click)="cancelAction=true; closeModal()"> Cancel </button>
- <button class="btn btn-md btn-primary" (click)="onSubmit()" [disabled]="!addTargetForm.valid">Add Folder</button>
+ <button class="btn btn-md btn-primary" (click)="onSubmit()" [disabled]="!addTargetForm.valid">Add Target</button>
</div>
</div>
</div>