From e853427d19bbf70737d9d25f4bd1ad0ac61ff14b Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 27 May 2020 02:14:39 +0300 Subject: [PATCH 1/2] refactor(theme-basic): remove unneccessary variable --- .../application-layout.component.html | 15 ++++++++++++--- .../application-layout.component.ts | 6 +----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html index 1faaafaa58..2da4769955 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html @@ -22,14 +22,23 @@ diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts index e996d2f786..9c90292d96 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts @@ -15,8 +15,6 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy { // required for dynamic component static type = eLayoutType.application; - isDropdownChildDynamic: boolean; - isCollapsed = true; smallScreen: boolean; // do not set true or false @@ -31,8 +29,7 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy { private checkWindowWidth() { setTimeout(() => { - if (window.innerWidth < 768) { - this.isDropdownChildDynamic = false; + if (window.innerWidth < 992) { if (this.smallScreen === false) { this.isCollapsed = false; setTimeout(() => { @@ -41,7 +38,6 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy { } this.smallScreen = true; } else { - this.isDropdownChildDynamic = true; this.smallScreen = false; } }, 0); From 52156ac604cb29f2da87214b5c5b7136b6841a55 Mon Sep 17 00:00:00 2001 From: mehmet-erim Date: Wed, 27 May 2020 02:16:08 +0300 Subject: [PATCH 2/2] fix(theme-basic): change smallScreen breakpoint px resolves #3757 --- .../components/routes/routes.component.html | 4 +--- .../lib/components/routes/routes.component.ts | 20 +++---------------- .../theme-basic/src/lib/constants/styles.ts | 2 +- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html index 226e19c39e..6437233cb1 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html @@ -77,16 +77,14 @@ class="dropdown-submenu" ngbDropdown #dropdownSubmenu="ngbDropdown" - [display]="isDropdownChildDynamic ? 'dynamic' : 'static'" placement="right-top" [autoClose]="true" *abpPermission="child.requiredPolicy" - (openChange)="openChange($event, childrenContainer)" >
diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.ts b/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.ts index 22b30426fa..2ed204e0b0 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.ts @@ -1,8 +1,8 @@ -import { Component, OnInit, TrackByFunction, Input, Renderer2 } from '@angular/core'; -import { Observable } from 'rxjs'; import { ABP, ConfigState } from '@abp/ng.core'; -import { map } from 'rxjs/operators'; +import { Component, Input, Renderer2, TrackByFunction } from '@angular/core'; import { Select } from '@ngxs/store'; +import { Observable } from 'rxjs'; +import { map } from 'rxjs/operators'; @Component({ selector: 'abp-routes', @@ -15,9 +15,6 @@ export class RoutesComponent { @Input() smallScreen: boolean; - @Input() - isDropdownChildDynamic: boolean; - get visibleRoutes$(): Observable { return this.routes$.pipe(map(routes => getVisibleRoutes(routes))); } @@ -25,17 +22,6 @@ export class RoutesComponent { trackByFn: TrackByFunction = (_, item) => item.name; constructor(private renderer: Renderer2) {} - - openChange(event: boolean, childrenContainer: HTMLDivElement) { - if (!event) { - Object.keys(childrenContainer.style) - .filter(key => Number.isInteger(+key)) - .forEach(key => { - this.renderer.removeStyle(childrenContainer, childrenContainer.style[key]); - }); - this.renderer.removeStyle(childrenContainer, 'left'); - } - } } function getVisibleRoutes(routes: ABP.FullRoute[]) { diff --git a/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts b/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts index 975a3c02a1..0d9ebcc300 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts +++ b/npm/ng-packs/packages/theme-basic/src/lib/constants/styles.ts @@ -46,7 +46,7 @@ export default ` .container > .card { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; } -@media screen and (min-width: 768px) { +@media screen and (min-width: 992px) { .navbar .dropdown:hover > .dropdown-menu { display: block; }