Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/polymer/v0_8/components-chromium/paper-toast/paper-toast-extracted.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1
2 (function() {
3
4 var PaperToast = Polymer({
5 is: 'paper-toast',
6
7 properties: {
8 /**
9 * The duration in milliseconds to show the toast.
10 */
11 duration: {
12 type: Number,
13 value: 3000
14 },
15
16 /**
17 * The text to display in the toast.
18 */
19 text: {
20 type: String,
21 value: ""
22 },
23
24 /**
25 * True if the toast is currently visible.
26 */
27 visible: {
28 type: Boolean,
29 readOnly: true,
30 value: false,
31 observer: '_visibleChanged'
32 }
33 },
34
35 created: function() {
36 Polymer.IronA11yAnnouncer.requestAvailability();
37 },
38
39 ready: function() {
40 this.async(function() {
41 this.hide();
42 });
43 },
44
45 /**
46 * Show the toast.
47 * @method show
48 */
49 show: function() {
50 if (PaperToast.currentToast) {
51 PaperToast.currentToast.hide();
52 }
53 PaperToast.currentToast = this;
54 this.removeAttribute('aria-hidden');
55 this._setVisible(true);
56 this.fire('iron-announce', {
57 text: this.text
58 });
59 this.debounce('hide', this.hide, this.duration);
60 },
61
62 /**
63 * Hide the toast
64 */
65 hide: function() {
66 this.setAttribute('aria-hidden', 'true');
67 this._setVisible(false);
68 },
69
70 /**
71 * Toggle the opened state of the toast.
72 * @method toggle
73 */
74 toggle: function() {
75 if (!this.visible) {
76 this.show();
77 } else {
78 this.hide();
79 }
80 },
81
82 _visibleChanged: function(visible) {
83 this.toggleClass('paper-toast-open', visible);
84 }
85 });
86
87 PaperToast.currentToast = null;
88
89 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698