Browse Source

refactor(theme-basic): remove unneccessary variable

pull/4109/head
mehmet-erim 6 years ago
parent
commit
e853427d19
  1. 15
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html
  2. 6
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts

15
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html

@ -22,14 +22,23 @@
<ng-template #navigations>
<abp-routes
*abpReplaceableTemplate="{ componentKey: routesComponentKey }"
*abpReplaceableTemplate="{
componentKey: routesComponentKey,
inputs: {
smallScreen: { value: smallScreen }
}
}"
class="mx-auto"
[smallScreen]="smallScreen"
[isDropdownChildDynamic]="isDropdownChildDynamic"
></abp-routes>
<abp-nav-items
*abpReplaceableTemplate="{ componentKey: navItemsComponentKey }"
*abpReplaceableTemplate="{
componentKey: navItemsComponentKey,
inputs: {
smallScreen: { value: smallScreen }
}
}"
[smallScreen]="smallScreen"
></abp-nav-items>
</ng-template>

6
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);

Loading…
Cancel
Save