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

Unified Diff: res/imp/error-toast-sk.html

Issue 2309423004: Give error-toast a duration argument (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Address comments Created 4 years, 3 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
« no previous file with comments | « no previous file | res/js/common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: res/imp/error-toast-sk.html
diff --git a/res/imp/error-toast-sk.html b/res/imp/error-toast-sk.html
index e3684177085db32ed2dc2b120d1d41da34ba34e1..139ee6223b6b0bf529e6f50a14a38626aa776539 100644
--- a/res/imp/error-toast-sk.html
+++ b/res/imp/error-toast-sk.html
@@ -7,6 +7,8 @@
{
message: "The error message to display goes here.",
+ duration: Integer, the number of ms to display or 0 for indefinitely.
+ Defaults to 10000 (10s)
}
Attributes:
@@ -17,7 +19,7 @@
<dom-module id="error-toast-sk">
<template>
- <paper-toast id=toast duration=10000></paper-toast>
+ <paper-toast id=toast></paper-toast>
</template>
</dom-module>
@@ -26,8 +28,11 @@
is: "error-toast-sk",
ready: function() {
document.addEventListener('error-sk', function(e) {
+ this.$.toast.close();
if (e.detail.message) {
this.$.toast.text = e.detail.message;
+ // duration = 0 is a valid input for "keep open indefinitely".
+ this.$.toast.duration = (e.detail.duration === undefined ? 10000 : e.detail.duration)
this.$.toast.show();
} else {
console.log("Empty message?", e);
« no previous file with comments | « no previous file | res/js/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698