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

Side by Side Diff: res/js/common.js

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 unified diff | Download patch
« no previous file with comments | « res/imp/error-toast-sk.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * common.js is a set of common functions used across all of skiaperf. 2 * common.js is a set of common functions used across all of skiaperf.
3 * 3 *
4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they 4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they
5 * are used so often. 5 * are used so often.
6 * 6 *
7 */ 7 */
8 8
9 /** 9 /**
10 * $$ returns a real JS array of DOM elements that match the CSS query selector. 10 * $$ returns a real JS array of DOM elements that match the CSS query selector.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return null; 64 return null;
65 } 65 }
66 66
67 /** 67 /**
68 * errorMessage dispatches an event with the error message in it. 68 * errorMessage dispatches an event with the error message in it.
69 * 69 *
70 * See <error-toast-sk> for an element that listens for such events 70 * See <error-toast-sk> for an element that listens for such events
71 * and displays the error messages. 71 * and displays the error messages.
72 * 72 *
73 */ 73 */
74 sk.errorMessage = function(message) { 74 sk.errorMessage = function(message, duration) {
75 var detail = { 75 var detail = {
76 message: message, 76 message: message,
77 } 77 }
78 detail.duration = duration;
78 document.dispatchEvent(new CustomEvent('error-sk', {detail: detail, bubbles: true})); 79 document.dispatchEvent(new CustomEvent('error-sk', {detail: detail, bubbles: true}));
79 } 80 }
80 81
81 /** 82 /**
82 * Importer simplifies importing HTML Templates from HTML Imports. 83 * Importer simplifies importing HTML Templates from HTML Imports.
83 * 84 *
84 * Just instantiate an instance in the HTML Import: 85 * Just instantiate an instance in the HTML Import:
85 * 86 *
86 * importer = new sk.Importer(); 87 * importer = new sk.Importer();
87 * 88 *
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 // returns true iff the string starts with the given prefix 828 // returns true iff the string starts with the given prefix
828 if (!String.prototype.startsWith) { 829 if (!String.prototype.startsWith) {
829 String.prototype.startsWith = function(searchString, position) { 830 String.prototype.startsWith = function(searchString, position) {
830 position = position || 0; 831 position = position || 0;
831 return this.indexOf(searchString, position) === position; 832 return this.indexOf(searchString, position) === position;
832 }; 833 };
833 } 834 }
834 835
835 return sk; 836 return sk;
836 }(); 837 }();
OLDNEW
« no previous file with comments | « res/imp/error-toast-sk.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698