mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(router): fixes navChanged()
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user