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

Side by Side Diff: chrome/browser/resources/md_downloads/manager.js

Issue 1300473002: MD Download: add "Nothing to see here..." empty downloads message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less flicker? Created 5 years, 4 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('downloads', function() { 5 cr.define('downloads', function() {
6 var Manager = Polymer({ 6 var Manager = Polymer({
7 is: 'downloads-manager', 7 is: 'downloads-manager',
8 8
9 created: function() { 9 created: function() {
10 /** @private {!downloads.ActionService} */ 10 /** @private {!downloads.ActionService} */
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // If |before| is null, |item| will just get added at the end. 153 // If |before| is null, |item| will just get added at the end.
154 this.$['downloads-list'].insertBefore(item, before); 154 this.$['downloads-list'].insertBefore(item, before);
155 } 155 }
156 156
157 this.hasDownloads_ = this.size_() > 0; 157 this.hasDownloads_ = this.size_() > 0;
158 158
159 if (loadTimeData.getBoolean('allowDeletingHistory')) 159 if (loadTimeData.getBoolean('allowDeletingHistory'))
160 this.$.toolbar.downloadsShowing = this.hasDownloads_; 160 this.$.toolbar.downloadsShowing = this.hasDownloads_;
161 161
162 this.onResize_(); 162 this.onResize_();
163 this.$.panel.classList.remove('loading');
163 }, 164 },
164 165
165 /** 166 /**
166 * @param {!downloads.Data} data 167 * @param {!downloads.Data} data
167 * @private 168 * @private
168 */ 169 */
169 updateItem_: function(data) { 170 updateItem_: function(data) {
170 this.idMap_[data.id].update(data); 171 this.idMap_[data.id].update(data);
171 this.onResize_(); 172 this.onResize_();
172 }, 173 },
(...skipping 12 matching lines...) Expand all
185 }; 186 };
186 187
187 Manager.onLoad = function() { 188 Manager.onLoad = function() {
188 document.querySelector('downloads-manager').onLoad_(); 189 document.querySelector('downloads-manager').onLoad_();
189 }; 190 };
190 191
191 return {Manager: Manager}; 192 return {Manager: Manager};
192 }); 193 });
193 194
194 window.addEventListener('load', downloads.Manager.onLoad); 195 window.addEventListener('load', downloads.Manager.onLoad);
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_downloads/manager.html ('k') | chrome/browser/ui/webui/downloads_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698