Skip to content

Commit

Permalink
fix(router-outlet): css and change logic
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Mar 21, 2018
1 parent a98c764 commit 6e683c5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 33 deletions.
17 changes: 13 additions & 4 deletions core/src/components/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,31 @@ sub {
// --------------------------------------------------

ion-app,
ion-router-outlet,
ion-tab,
ion-tabs,
ion-nav,
.ion-page {
@include position(0);

position: absolute;
z-index: $z-index-page-container;
display: flex;

flex-direction: column;
justify-content: space-between;
overflow: hidden;

width: 100%;
height: 100%;

contain: layout size style;
}

ion-app,
.ion-page {
display: flex;

flex-direction: column;
justify-content: space-between;
}

.hide-page {
opacity: 0;
}
Expand Down
14 changes: 0 additions & 14 deletions core/src/components/nav/nav.scss

This file was deleted.

1 change: 0 additions & 1 deletion core/src/components/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import mdTransitionAnimation from './animations/md.transition';

@Component({
tag: 'ion-nav',
styleUrl: 'nav.scss'
})
export class NavControllerBase implements NavOutlet {

Expand Down
7 changes: 5 additions & 2 deletions core/src/components/router-outlet/route-outlet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class RouterOutlet implements NavOutlet {

private isTransitioning = false;
private activeEl: HTMLElement = undefined;
private activeComponent: any;

mode: string;

Expand All @@ -28,14 +29,16 @@ export class RouterOutlet implements NavOutlet {
@Prop() delegate: FrameworkDelegate;

componentDidUnload() {
this.activeEl = undefined;
this.activeEl = this.activeComponent = undefined;
}

@Method()
async setRoot(component: HTMLElement|string, params?: {[key: string]: any}, opts?: RouterOutletOptions): Promise<boolean> {
if (this.isTransitioning) {
if (this.isTransitioning || this.activeComponent === component) {
return false;
}
this.activeComponent = component;

// attach entering view to DOM
const enteringEl = await attachComponent(this.delegate, this.el, component, ['ion-page', 'hide-page'], params);
const leavingEl = this.activeEl;
Expand Down
10 changes: 0 additions & 10 deletions core/src/components/tab/tab.scss

This file was deleted.

3 changes: 1 addition & 2 deletions core/src/components/tab/tab.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Build, Component, Element, Event, EventEmitter, Method, Prop, State, Watch } from '@stencil/core';

@Component({
tag: 'ion-tab',
styleUrl: 'tab.scss'
tag: 'ion-tab'
})
export class Tab {

Expand Down

0 comments on commit 6e683c5

Please sign in to comment.