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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v0_8/components-chromium/paper-toast/paper-toast-extracted.js
diff --git a/third_party/polymer/v0_8/components-chromium/paper-toast/paper-toast-extracted.js b/third_party/polymer/v0_8/components-chromium/paper-toast/paper-toast-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..999b6d701a1229bdf3f1be13dfa5adfc28b02ad0
--- /dev/null
+++ b/third_party/polymer/v0_8/components-chromium/paper-toast/paper-toast-extracted.js
@@ -0,0 +1,89 @@
+
+(function() {
+
+ var PaperToast = Polymer({
+ is: 'paper-toast',
+
+ properties: {
+ /**
+ * The duration in milliseconds to show the toast.
+ */
+ duration: {
+ type: Number,
+ value: 3000
+ },
+
+ /**
+ * The text to display in the toast.
+ */
+ text: {
+ type: String,
+ value: ""
+ },
+
+ /**
+ * True if the toast is currently visible.
+ */
+ visible: {
+ type: Boolean,
+ readOnly: true,
+ value: false,
+ observer: '_visibleChanged'
+ }
+ },
+
+ created: function() {
+ Polymer.IronA11yAnnouncer.requestAvailability();
+ },
+
+ ready: function() {
+ this.async(function() {
+ this.hide();
+ });
+ },
+
+ /**
+ * Show the toast.
+ * @method show
+ */
+ show: function() {
+ if (PaperToast.currentToast) {
+ PaperToast.currentToast.hide();
+ }
+ PaperToast.currentToast = this;
+ this.removeAttribute('aria-hidden');
+ this._setVisible(true);
+ this.fire('iron-announce', {
+ text: this.text
+ });
+ this.debounce('hide', this.hide, this.duration);
+ },
+
+ /**
+ * Hide the toast
+ */
+ hide: function() {
+ this.setAttribute('aria-hidden', 'true');
+ this._setVisible(false);
+ },
+
+ /**
+ * Toggle the opened state of the toast.
+ * @method toggle
+ */
+ toggle: function() {
+ if (!this.visible) {
+ this.show();
+ } else {
+ this.hide();
+ }
+ },
+
+ _visibleChanged: function(visible) {
+ this.toggleClass('paper-toast-open', visible);
+ }
+ });
+
+ PaperToast.currentToast = null;
+
+})();

Powered by Google App Engine
This is Rietveld 408576698