From 4d43c99764ffd5fbbbafc1c74c618781310cb7f1 Mon Sep 17 00:00:00 2001 From: fukino Date: Wed, 12 Nov 2014 23:46:46 -0800 Subject: [PATCH] Set the 'drive' attribute correctly based on the Drive volume status. The 'status' variable used in the function was removed in crrev.com/23526060, but it's still in use (as undefined value). This CL sets the 'drive' attribute in accordance with the description in crrev.com/23526060. BUG=none TEST=run browser_tests gtest_filter=*FileManager* Review URL: https://codereview.chromium.org/699593006 Cr-Commit-Position: refs/heads/master@{#304002} --- .../file_manager/foreground/css/file_manager.css | 15 --------------- .../file_manager/foreground/js/ui/drive_banners.js | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css index 03388559e96f..10b3d2bbf04e 100644 --- a/ui/file_manager/file_manager/foreground/css/file_manager.css +++ b/ui/file_manager/file_manager/foreground/css/file_manager.css @@ -1258,14 +1258,12 @@ div.shade[fadein] { top: 0; } -body[drive='mounting'] .dialog-container #unmounted-panel, body[drive='error'] .dialog-container #unmounted-panel, body[unformatted] .dialog-container #format-panel { display: block; } body[drive='unmounted'] .dialog-container .filelist-panel, -body[drive='mounting'] .dialog-container .filelist-panel, body[drive='error'] .dialog-container .filelist-panel, body[unformatted] .dialog-container .filelist-panel { /* Hide file list when Drive is not mounted. @@ -1283,20 +1281,7 @@ body[unformatted] .dialog-container .filelist-panel { margin-bottom: 10px; } -#unmounted-panel > .loading { - position: relative; -} - -#unmounted-panel > .loading > .spinner-box { - bottom: 0; - position: absolute; - right: 100%; - top: 0; - width: 40px; -} - body[unformatted] #format-panel > .error, -body[drive='mounting'] #unmounted-panel > .loading, body[drive='error'] #unmounted-panel > .error, #format-panel > #format-button, #unmounted-panel.retry-enabled > .learn-more { diff --git a/ui/file_manager/file_manager/foreground/js/ui/drive_banners.js b/ui/file_manager/file_manager/foreground/js/ui/drive_banners.js index 4f8519113b69..d86d1c8ea4e8 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/drive_banners.js +++ b/ui/file_manager/file_manager/foreground/js/ui/drive_banners.js @@ -618,9 +618,6 @@ FileListBannerController.prototype.ensureDriveUnmountedPanelInitialized_ = return div; }; - var loading = create(panel, 'div', 'loading', str('DRIVE_LOADING')); - var spinnerBox = create(loading, 'div', 'spinner-box'); - create(spinnerBox, 'div', 'spinner'); create(panel, 'div', 'error', str('DRIVE_CANNOT_REACH')); var learnMore = create(panel, 'a', 'learn-more plain-link', @@ -644,8 +641,7 @@ FileListBannerController.prototype.onVolumeInfoListSplice_ = function(event) { /** * Shows the panel when current directory is DRIVE and it's unmounted. - * Hides it otherwise. The panel shows spinner if DRIVE is mounting or - * an error message if it failed. + * Hides it otherwise. The panel shows an error message if it failed. * @private */ FileListBannerController.prototype.updateDriveUnmountedPanel_ = function() { @@ -653,13 +649,18 @@ FileListBannerController.prototype.updateDriveUnmountedPanel_ = function() { if (this.isOnCurrentProfileDrive()) { var driveVolume = this.volumeManager_.getCurrentProfileVolumeInfo( VolumeManagerCommon.VolumeType.DRIVE); - if (driveVolume && driveVolume.error) { - this.ensureDriveUnmountedPanelInitialized_(); - this.unmountedPanel_.classList.add('retry-enabled'); + if (driveVolume) { + if (driveVolume.error) { + this.ensureDriveUnmountedPanelInitialized_(); + this.unmountedPanel_.classList.add('retry-enabled'); + node.setAttribute('drive', 'error'); + } else { + node.setAttribute('drive', 'mounted'); + } } else { this.unmountedPanel_.classList.remove('retry-enabled'); + node.setAttribute('drive', 'unmounted'); } - node.setAttribute('drive', status); } else { node.removeAttribute('drive'); } -- 2.11.4.GIT