fix(router): fixes navChanged()

This commit is contained in:
Manu Mtz.-Almeida
2018-03-26 22:07:00 +02:00
parent 076b7e55bd
commit dddaee1719
17 changed files with 120 additions and 111 deletions

View File

@@ -1,4 +1,5 @@
import { CssClassMap } from '../index';
import { RouterDirection } from '../components/router/utils/interfaces';
/**
* Create the mode and color classes for the component based on the classes passed in
@@ -65,12 +66,12 @@ export function getClassMap(classes: string | undefined): CssClassMap {
return map;
}
export function openURL(url: string, ev: Event, isPop = false) {
export function openURL(url: string, ev: Event, direction = RouterDirection.Forward) {
if (url && url[0] !== '#' && url.indexOf('://') === -1) {
const router = document.querySelector('ion-router');
if (router) {
ev && ev.preventDefault();
return router.componentOnReady().then(() => router.push(url, isPop));
return router.componentOnReady().then(() => router.push(url, direction));
}
}
return Promise.resolve();

View File

@@ -121,7 +121,7 @@ function fireDidEvents(enteringEl: HTMLElement, leavingEl: HTMLElement) {
function setZIndex(enteringEl: HTMLElement, leavingEl: HTMLElement, direction: NavDirection) {
if (enteringEl) {
enteringEl.style.zIndex = (direction === NavDirection.back)
enteringEl.style.zIndex = (direction === NavDirection.Back)
? '99'
: '101';
}