Skip to content

Commit

Permalink
Improve navigation menu (DevExpress#16)
Browse files Browse the repository at this point in the history
Improve navigation menu
  • Loading branch information
ovchinnikov authored Sep 18, 2018
1 parent 0169c11 commit df8ea98
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ng-content></ng-content>

<dx-tree-view
width="12em"
expandEvent="click"
[ngClass]="{ 'treeview-compact': compactMode }"
[items]="menuItems"
(onItemClick)="onItemSelectionChanged($event)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
:host {
display: block;
height: 100%;
min-width: 250px;

.dx-treeview {
white-space: nowrap;
Expand All @@ -13,19 +14,30 @@
}

.dx-treeview-item-content {
padding-left: 8px;
padding-left: 10px;
}

.dx-treeview-toggle-item-visibility {
right: 0;
right: 10px;
left: auto;
}

.dx-treeview-node[aria-level='1'] {
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
.dx-treeview-item-content span {
padding-left: 12px;
}
}

.dx-treeview-node[aria-level='2'] .dx-treeview-item-content {
font-weight: 300;
padding-left: 38px;
}
}

::ng-deep .treeview-compact {
.dx-treeview-item-content {
span {
visibility: hidden;
}
.dx-treeview-item-content span {
visibility: hidden;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ export class NavigationMenuComponent {
if (path) {
this.selectedItemChanged.emit(event.itemData.text);
this.router.navigate([path]);
} else {
const treeView = this.menu.instance;
event.node.expanded ? treeView.collapseItem(event.itemData) : treeView.expandItem(event.itemData);
}
}
}
Expand Down

0 comments on commit df8ea98

Please sign in to comment.