2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 `paper-toast` provides lightweight feedback about an operation in a small popup
10 at the base of the screen on mobile and at the lower left on desktop. Toasts are
11 above all other elements on screen, including the FAB.
13 Toasts automatically disappear after a timeout or after user interaction
14 elsewhere on the screen, whichever comes first. Toasts can be swiped off
15 screen. There can be only one on the screen at a time.
19 <paper-toast text="Your draft has been discarded." onclick="discardDraft(el)"></paper-toast>
22 function discardDraft(el) {
27 An action button can be presented in the toast.
29 Example (using Polymer's data-binding features):
31 <paper-toast id="toast2" text="Connection timed out. Showing limited messages.">
32 <div style="color: blue;" on-tap="{{retry}}">Retry</div>
37 A standard toast appears near the lower left of the screen. You can change the
38 position by overriding bottom and left positions.
45 To position the toast to the right:
52 To make it fit at the bottom of the screen:
60 When the screen size is smaller than the `responsiveWidth` (default to 480px),
61 the toast will automatically fits at the bottom of the screen.
67 Fired when the `paper-toast`'s `opened` property changes.
69 @event core-overlay-open
70 @param {boolean} detail the opened state
72 Fired when the `paper-toast` has completely opened.
74 @event core-overlay-open-completed
76 Fired when the `paper-toast` has completely closed.
78 @event core-overlay-close-completed
79 --><html><head><link rel="import" href="../core-overlay/core-overlay.html">
80 <link rel="import" href="../core-transition/core-transition-css.html">
81 <link rel="import" href="../core-media-query/core-media-query.html">
83 </head><body><polymer-element name="paper-toast" attributes="text duration opened responsiveWidth swipeDisabled autoCloseDisabled" role="status" assetpath="">
87 <link rel="stylesheet" href="paper-toast.css">
89 <core-overlay id="overlay" autofocusdisabled="" autoclosedisabled="{{autoCloseDisabled}}" opened="{{opened}}" target="{{}}" transition="core-transition-bottom"></core-overlay>
91 <div class="toast-container" horizontal="" layout="">
93 <div class="toast-text" flex="">{{text}}</div>
95 <div class="toast-text toast-action" on-tap="{{dismiss}}">
101 <core-media-query query="max-width: {{responsiveWidth}}" querymatches="{{narrowMode}}"></core-media-query>
106 <script src="paper-toast-extracted.js"></script></body></html>