fix(toast): add position middle

This commit is contained in:
Manu Mtz.-Almeida
2018-08-27 21:52:56 +02:00
parent 1f71f76582
commit 25479e4ad8
2 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,7 @@ export interface ToastOptions {
duration?: number; duration?: number;
showCloseButton?: boolean; showCloseButton?: boolean;
closeButtonText?: string; closeButtonText?: string;
position?: 'top' | 'bottom'; position?: 'top' | 'bottom' | 'middle';
translucent?: boolean; translucent?: boolean;
enterAnimation?: AnimationBuilder; enterAnimation?: AnimationBuilder;
leaveAnimation?: AnimationBuilder; leaveAnimation?: AnimationBuilder;

View File

@ -71,7 +71,7 @@ export class Toast implements OverlayInterface {
/** /**
* The position of the toast on the screen. Possible values: "top", "middle", "bottom". * The position of the toast on the screen. Possible values: "top", "middle", "bottom".
*/ */
@Prop() position?: 'top' | 'bottom'; @Prop() position: 'top' | 'bottom' | 'middle' = 'bottom';
/** /**
* If true, the close button will be displayed. Defaults to `false`. * If true, the close button will be displayed. Defaults to `false`.
@ -190,10 +190,9 @@ export class Toast implements OverlayInterface {
} }
render() { render() {
const position = this.position ? this.position : 'bottom';
const wrapperClass = { const wrapperClass = {
'toast-wrapper': true, 'toast-wrapper': true,
[`toast-${position}`]: true [`toast-${this.position}`]: true
}; };
return ( return (
<div class={wrapperClass}> <div class={wrapperClass}>