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 properties: { | 9 properties: { |
10 /** @private */ | 10 /** @private */ |
(...skipping 22 matching lines...) Expand all Loading... |
33 }, | 33 }, |
34 | 34 |
35 /** @private */ | 35 /** @private */ |
36 spinnerActive_: { | 36 spinnerActive_: { |
37 type: Boolean, | 37 type: Boolean, |
38 notify: true, | 38 notify: true, |
39 }, | 39 }, |
40 }, | 40 }, |
41 | 41 |
42 hostAttributes: { | 42 hostAttributes: { |
| 43 // TODO(dbeam): this should use a class instead. |
43 loading: true, | 44 loading: true, |
44 }, | 45 }, |
45 | 46 |
46 listeners: { | 47 listeners: { |
47 'downloads-list.scroll': 'onListScroll_', | 48 'downloads-list.scroll': 'onListScroll_', |
48 'toolbar.search-changed': 'onSearchChanged_', | 49 'toolbar.search-changed': 'onSearchChanged_', |
49 }, | 50 }, |
50 | 51 |
51 observers: [ | 52 observers: [ |
52 'itemsChanged_(items_.*)', | 53 'itemsChanged_(items_.*)', |
53 ], | 54 ], |
54 | 55 |
| 56 attached: function() { |
| 57 document.documentElement.classList.remove('loading'); |
| 58 }, |
| 59 |
55 /** @private {!PromiseResolver} */ | 60 /** @private {!PromiseResolver} */ |
56 loaded_: new PromiseResolver, | 61 loaded_: new PromiseResolver, |
57 | 62 |
58 /** @private */ | 63 /** @private */ |
59 clearAll_: function() { | 64 clearAll_: function() { |
60 this.set('items_', []); | 65 this.set('items_', []); |
61 }, | 66 }, |
62 | 67 |
63 /** @private */ | 68 /** @private */ |
64 hasDownloadsChanged_: function() { | 69 hasDownloadsChanged_: function() { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 Manager.removeItem = function(index) { | 236 Manager.removeItem = function(index) { |
232 Manager.get().removeItem_(index); | 237 Manager.get().removeItem_(index); |
233 }; | 238 }; |
234 | 239 |
235 Manager.updateItem = function(index, data) { | 240 Manager.updateItem = function(index, data) { |
236 Manager.get().updateItem_(index, data); | 241 Manager.get().updateItem_(index, data); |
237 }; | 242 }; |
238 | 243 |
239 return {Manager: Manager}; | 244 return {Manager: Manager}; |
240 }); | 245 }); |
OLD | NEW |