OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * Responsible for showing banners in the file list. | 6 * Responsible for showing banners in the file list. |
7 * @param {DirectoryModel} directoryModel The model. | 7 * @param {DirectoryModel} directoryModel The model. |
8 * @param {VolumeManager} volumeManager The manager. | 8 * @param {VolumeManager} volumeManager The manager. |
9 * @param {DOMDocument} document HTML document. | 9 * @param {DOMDocument} document HTML document. |
10 * @constructor | 10 * @constructor |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
527 learnMore.target = '_blank'; | 527 learnMore.target = '_blank'; |
528 }; | 528 }; |
529 | 529 |
530 /** | 530 /** |
531 * Shows the panel when current directory is DRIVE and it's unmounted. | 531 * Shows the panel when current directory is DRIVE and it's unmounted. |
532 * Hides it otherwise. The pannel shows spinner if DRIVE is mounting or | 532 * Hides it otherwise. The pannel shows spinner if DRIVE is mounting or |
533 * an error message if it failed. | 533 * an error message if it failed. |
534 * @private | 534 * @private |
535 */ | 535 */ |
536 FileListBannerController.prototype.updateDriveUnmountedPanel_ = function() { | 536 FileListBannerController.prototype.updateDriveUnmountedPanel_ = function() { |
537 var node = this.document_.querySelector('.dialog-container'); | 537 var node = this.document_.querySelector('body'); |
yoshiki
2013/02/08 06:15:38
You can use just "document.body".
| |
538 if (this.isOnDrive()) { | 538 if (this.isOnDrive()) { |
539 var status = this.volumeManager_.getDriveStatus(); | 539 var status = this.volumeManager_.getDriveStatus(); |
540 if (status == VolumeManager.DriveStatus.MOUNTING || | 540 if (status == VolumeManager.DriveStatus.MOUNTING || |
541 status == VolumeManager.DriveStatus.ERROR) { | 541 status == VolumeManager.DriveStatus.ERROR) { |
542 this.ensureDriveUnmountedPanelInitialized_(); | 542 this.ensureDriveUnmountedPanelInitialized_(); |
543 } | 543 } |
544 if (status == VolumeManager.DriveStatus.MOUNTING && | 544 if (status == VolumeManager.DriveStatus.MOUNTING && |
545 this.welcomeHeaderCounter_ == 0) { | 545 this.welcomeHeaderCounter_ == 0) { |
546 // Do not increment banner counter in order to not prevent the full | 546 // Do not increment banner counter in order to not prevent the full |
547 // page banner of being shown (otherwise it would never be shown). | 547 // page banner of being shown (otherwise it would never be shown). |
(...skipping 26 matching lines...) Expand all Loading... | |
574 * @param {Function} completeCallback To be called (may be directly) when | 574 * @param {Function} completeCallback To be called (may be directly) when |
575 * this.newWelcome_ get ready. | 575 * this.newWelcome_ get ready. |
576 * @private | 576 * @private |
577 */ | 577 */ |
578 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { | 578 FileListBannerController.prototype.preparePromo_ = function(completeCallback) { |
579 if (this.newWelcome_ !== undefined) | 579 if (this.newWelcome_ !== undefined) |
580 completeCallback(); | 580 completeCallback(); |
581 else | 581 else |
582 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); | 582 (this.promoCallbacks_ = this.promoCallbacks_ || []).push(completeCallback); |
583 }; | 583 }; |
OLD | NEW |