OLD | NEW |
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 Loading... |
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 Loading... |
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); |
OLD | NEW |