| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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('wallpapers', function() { | 5 cr.define('wallpapers', function() { |
| 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 7 /** @const */ var Grid = cr.ui.Grid; | 7 /** @const */ var Grid = cr.ui.Grid; |
| 8 /** @const */ var GridItem = cr.ui.GridItem; | 8 /** @const */ var GridItem = cr.ui.GridItem; |
| 9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; | 9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; |
| 10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 this.style.visibility = 'hidden'; | 284 this.style.visibility = 'hidden'; |
| 285 // If spinner is hidden, schedule to show the spinner after | 285 // If spinner is hidden, schedule to show the spinner after |
| 286 // ShowSpinnerDelayMs delay. Otherwise, keep it spinning. | 286 // ShowSpinnerDelayMs delay. Otherwise, keep it spinning. |
| 287 if ($('spinner-container').hidden) { | 287 if ($('spinner-container').hidden) { |
| 288 this.spinnerTimeout_ = window.setTimeout(function() { | 288 this.spinnerTimeout_ = window.setTimeout(function() { |
| 289 $('spinner-container').hidden = false; | 289 $('spinner-container').hidden = false; |
| 290 }, ShowSpinnerDelayMs); | 290 }, ShowSpinnerDelayMs); |
| 291 } | 291 } |
| 292 } else { | 292 } else { |
| 293 // Sets dataModel to null should hide spinner immedidately. | 293 // Sets dataModel to null should hide spinner immediately. |
| 294 $('spinner-container').hidden = true; | 294 $('spinner-container').hidden = true; |
| 295 } | 295 } |
| 296 | 296 |
| 297 var parentSetter = cr.ui.Grid.prototype.__lookupSetter__('dataModel'); | 297 var parentSetter = cr.ui.Grid.prototype.__lookupSetter__('dataModel'); |
| 298 parentSetter.call(this, dataModel); | 298 parentSetter.call(this, dataModel); |
| 299 }, | 299 }, |
| 300 | 300 |
| 301 get dataModel() { | 301 get dataModel() { |
| 302 return this.dataModel_; | 302 return this.dataModel_; |
| 303 }, | 303 }, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // The active thumbnail maybe deleted in the above redraw(). Sets it again | 431 // The active thumbnail maybe deleted in the above redraw(). Sets it again |
| 432 // to make sure checkmark shows correctly. | 432 // to make sure checkmark shows correctly. |
| 433 this.updateActiveThumb_(); | 433 this.updateActiveThumb_(); |
| 434 } | 434 } |
| 435 }; | 435 }; |
| 436 | 436 |
| 437 return { | 437 return { |
| 438 WallpaperThumbnailsGrid: WallpaperThumbnailsGrid | 438 WallpaperThumbnailsGrid: WallpaperThumbnailsGrid |
| 439 }; | 439 }; |
| 440 }); | 440 }); |
| OLD | NEW |