diff --git a/demo-shell/src/app/components/app-layout/app-layout.component.html b/demo-shell/src/app/components/app-layout/app-layout.component.html index 19b05f27ea..1d3372f0f4 100644 --- a/demo-shell/src/app/components/app-layout/app-layout.component.html +++ b/demo-shell/src/app/components/app-layout/app-layout.component.html @@ -35,7 +35,7 @@ {{link.icon}} @@ -85,4 +85,4 @@ {{ link.title | translate }} - \ No newline at end of file + diff --git a/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts b/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts index 067916f27a..9a58ef16c1 100644 --- a/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts +++ b/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts @@ -15,43 +15,24 @@ * limitations under the License. */ -import { Directive, HostListener, Input } from '@angular/core'; +import { Directive, HostListener } from '@angular/core'; @Directive({ selector: '[appNestedMenuPosition]' }) export class NestedMenuPositionDirective { - @Input() - menuMinimized: string; - nestedMenuLeftPadding: string = '220px'; @HostListener('click', ['$event']) - onClick(event: any) { + onClick() { - const bodyRect = document.body.getBoundingClientRect(); let overlayContainer = (document.querySelector('.cdk-overlay-connected-position-bounding-box') as HTMLElement); (document.querySelector('.cdk-overlay-pane') as HTMLElement).style.width = '100%'; - if (this.menuMinimized === 'false') { - setTimeout( () => { - const elementPosition = this.getElementOffset(event); - overlayContainer.style.top = elementPosition.top - bodyRect.top + 'px'; - overlayContainer.style.left = this.nestedMenuLeftPadding; - }); - } - } + setTimeout(() => { + overlayContainer.style.left = this.nestedMenuLeftPadding; + }); + } - isMenuClicked(item: string) { - return item.includes('adf-sidenav-menu-label'); - } - - getElementOffset(event) { - if (this.isMenuClicked(event.target.className)) { - return event.target.offsetParent.getBoundingClientRect(); - } else { - return event.target.getBoundingClientRect(); - } - } } diff --git a/e2e/pages/adf/navigationBarPage.ts b/e2e/pages/adf/navigationBarPage.ts index daf3608052..8c630cc8d5 100644 --- a/e2e/pages/adf/navigationBarPage.ts +++ b/e2e/pages/adf/navigationBarPage.ts @@ -56,6 +56,7 @@ export class NavigationBarPage { navigateToDatatable() { Util.waitUntilElementIsVisible(this.dataTableButton); this.dataTableButton.click(); + Util.waitUntilElementIsVisible(this.dataTableNestedButton); this.dataTableNestedButton.click(); }