fix(fab-button): add routerDirection

fixes #15551
This commit is contained in:
Manu Mtz.-Almeida
2018-09-11 17:49:36 +02:00
parent fcb45d12e2
commit 239863465c
4 changed files with 31 additions and 13 deletions

View File

@ -1,7 +1,7 @@
import { Component, Element, Prop } from '@stencil/core';
import { Color, CssClassMap, Mode } from '../../interface';
import { createColorClasses } from '../../utils/theme';
import { Color, CssClassMap, Mode, RouterDirection } from '../../interface';
import { createColorClasses, openURL } from '../../utils/theme';
@Component({
tag: 'ion-fab-button',
@ -14,6 +14,8 @@ import { createColorClasses } from '../../utils/theme';
export class FabButton {
private inList = false;
@Prop({ context: 'window' }) win!: Window;
@Element() el!: HTMLElement;
/**
@ -39,6 +41,12 @@ export class FabButton {
*/
@Prop() disabled = false;
/**
* When using a router, it specifies the transition direction when navigating to
* another page using `href`.
*/
@Prop() routerDirection?: RouterDirection;
/**
* Contains a URL or a URL fragment that the hyperlink points to.
* If this property is set, an anchor tag will be rendered.
@ -94,6 +102,7 @@ export class FabButton {
class="fab-button-native"
disabled={this.disabled}
href={this.href}
onClick={ev => openURL(this.win, this.href, ev, this.routerDirection)}
>
<span class="fab-button-close-icon">
<ion-icon name="close" lazy={false}></ion-icon>