mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
@ -64,6 +64,9 @@ export class IonTabs {
|
|||||||
? href
|
? href
|
||||||
: this.outlet.getLastUrl(tab) || href;
|
: this.outlet.getLastUrl(tab) || href;
|
||||||
|
|
||||||
return this.navCtrl.navigateBack(url);
|
return this.navCtrl.navigateRoot(url, {
|
||||||
|
animated: true,
|
||||||
|
animationDirection: 'back'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,25 +44,20 @@ export class NavController {
|
|||||||
|
|
||||||
navigateForward(url: string | UrlTree | any[], options: NavigationOptions = {}) {
|
navigateForward(url: string | UrlTree | any[], options: NavigationOptions = {}) {
|
||||||
this.setDirection('forward', options.animated, options.animationDirection);
|
this.setDirection('forward', options.animated, options.animationDirection);
|
||||||
if (Array.isArray(url)) {
|
this.navigate(url, options);
|
||||||
return this.router!.navigate(url, options);
|
|
||||||
} else {
|
|
||||||
return this.router!.navigateByUrl(url, options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateBack(url: string | UrlTree | any[], options: NavigationOptions = {}) {
|
navigateBack(url: string | UrlTree | any[], options: NavigationOptions = {}) {
|
||||||
this.setDirection('back', options.animated, options.animationDirection);
|
this.setDirection('back', options.animated, options.animationDirection);
|
||||||
// extras = { replaceUrl: true, ...extras };
|
this.navigate(url, options);
|
||||||
if (Array.isArray(url)) {
|
|
||||||
return this.router!.navigate(url, options);
|
|
||||||
} else {
|
|
||||||
return this.router!.navigateByUrl(url, options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateRoot(url: string | UrlTree | any[], options: NavigationOptions = {}) {
|
navigateRoot(url: string | UrlTree | any[], options: NavigationOptions = {}) {
|
||||||
this.setDirection('root', options.animated, options.animationDirection);
|
this.setDirection('root', options.animated, options.animationDirection);
|
||||||
|
this.navigate(url, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
navigate(url: string | UrlTree | any[], options: NavigationOptions) {
|
||||||
if (Array.isArray(url)) {
|
if (Array.isArray(url)) {
|
||||||
return this.router!.navigate(url, options);
|
return this.router!.navigate(url, options);
|
||||||
} else {
|
} else {
|
||||||
|
@ -139,8 +139,7 @@ async function overlayAnimation(
|
|||||||
overlay.animation.destroy();
|
overlay.animation.destroy();
|
||||||
overlay.animation = undefined;
|
overlay.animation = undefined;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
} else {
|
|
||||||
// Make overlay visible in case it's hidden
|
// Make overlay visible in case it's hidden
|
||||||
baseEl.classList.remove('overlay-hidden');
|
baseEl.classList.remove('overlay-hidden');
|
||||||
|
|
||||||
@ -164,7 +163,6 @@ async function overlayAnimation(
|
|||||||
overlay.animation = undefined;
|
overlay.animation = undefined;
|
||||||
return hasCompleted;
|
return hasCompleted;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export function autoFocus(containerEl: HTMLElement): HTMLElement | undefined {
|
export function autoFocus(containerEl: HTMLElement): HTMLElement | undefined {
|
||||||
const focusableEls = containerEl.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]');
|
const focusableEls = containerEl.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]');
|
||||||
|
Reference in New Issue
Block a user