Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
feat(toast): add dynamic start and end positions.
Browse files Browse the repository at this point in the history
The `start` and `end` positions are dynamic and are useful when using a bi-directional application with RTL and LTR

Fixes #7263

Closes #7318
  • Loading branch information
devversion authored and ThomasBurleson committed Jun 2, 2016
1 parent e85e1b9 commit 7f776a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/toast/toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ function MdToastDirective($mdToast) {
* - `hideDelay` - `{number=}`: How many milliseconds the toast should stay
* active before automatically closing. Set to 0 or false to have the toast stay open until
* closed manually. Default: 3000.
* - `position` - `{string=}`: Where to place the toast. Available: any combination
* of 'bottom', 'left', 'top', 'right'. Default: 'bottom left'.
* - `position` - `{string=}`: Sets the position of the toast. <br/>
* Available: any combination of `'bottom'`, `'left'`, `'top'`, `'right'`, `'end'` and `'start'`.
* The properties `'end'` and `'start'` are dynamic and can be used for RTL support.<br/>
* Default combination: `'bottom left'`.
* - `controller` - `{string=}`: The controller to associate with this toast.
* The controller will be injected the local `$mdToast.hide( )`, which is a function
* used to hide the toast.
Expand Down
9 changes: 9 additions & 0 deletions src/components/toast/toast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ md-toast {
top: 0;
}

// Support for RTL alignment
&._md-start {
@include rtl-prop(left, right, 0);
}

&._md-end {
@include rtl-prop(right, left, 0);
}

/*
* When the toast doesn't take up the whole screen,
* make it rotate when the user swipes it away
Expand Down

0 comments on commit 7f776a1

Please sign in to comment.