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

Side by Side Diff: chrome/browser/resources/md_bookmarks/toast.js

Issue 2898303004: [MD Bookmarks] Add toasts. (Closed)
Patch Set: address comments Created 3 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 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 Polymer({
6 is: 'bookmarks-toast',
7
8 properties: {
9 open: {
10 type: Boolean,
11 reflectToAttribute: true,
12 observer: 'openChanged_',
13 },
14
15 // Leaving duration undefined or set to 0 will make the toast show forever.
16 duration: Number,
dpapad 2017/06/01 17:35:44 Nit: Can we give this an initial value of 0? This
calamity 2017/06/02 05:34:22 Done.
17 },
18
19 /** @private */
20 openChanged_: function() {
21 if (!this.open || !this.duration)
22 return;
23
24 setTimeout(function() {
dpapad 2017/06/01 17:35:44 Shouldn't we be canceling this timeout to avoid ra
calamity 2017/06/02 05:34:22 Good catch! Done.
25 this.open = false;
26 }.bind(this), this.duration);
27 },
28 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698