Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 14799005: Fix legacy UI in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 05df67323553426f66414ce04e1f68b7a461359c..e753bdd2efa75a67c35a1614d4fa47a5ff15fe39 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -769,7 +769,10 @@ DialogType.isModal = function(type) {
dom.querySelector('#search-breadcrumbs'), this.metadataCache_);
this.searchBreadcrumbs_.addEventListener(
'pathclick', this.onBreadcrumbClick_.bind(this));
- this.searchBreadcrumbs_.setHideLast(true);
+ if (!util.platform.newUI())
+ this.searchBreadcrumbs_.setHideLast(true);
+ else
+ this.searchBreadcrumbs_.setHideLast(false);
var fullPage = this.dialogType == DialogType.FULL_PAGE;
FileTable.decorate(this.table_, this.metadataCache_, fullPage);
@@ -1062,10 +1065,11 @@ DialogType.isModal = function(type) {
FileManager.prototype.initSidebar_ = function() {
this.directoryTree_ = this.dialogDom_.querySelector('#directory-tree');
DirectoryTree.decorate(this.directoryTree_, this.directoryModel_);
- this.directoryTree_.addEventListener('content-updated', function() {
- this.updateMiddleBarVisibility_(true);
- }.bind(this));
if (util.platform.newUI()) {
+ this.directoryTree_.addEventListener('content-updated', function() {
+ this.updateMiddleBarVisibility_(true);
+ }.bind(this));
+
this.volumeList_ = this.dialogDom_.querySelector('#volume-list');
VolumeList.decorate(this.volumeList_, this.directoryModel_);
}
@@ -1428,11 +1432,12 @@ DialogType.isModal = function(type) {
this.table_.normalizeColumns();
}
this.table_.redraw();
- this.volumeList_.redraw();
}
if (!util.platform.newUI())
this.breadcrumbs_.truncate();
+ else
+ this.volumeList_.redraw();
// Hide the search box if there is not enough space.
if (util.platform.newUI())
@@ -2045,6 +2050,17 @@ DialogType.isModal = function(type) {
this.directoryModel_.getCurrentDirectoryURL();
};
+ /**
+ * Return DirectoryEntry of the current directory or null.
+ * @return {DirectoryEntry} DirectoryEntry of the current directory. Returns
+ * null if the directory model is not ready or the current directory is
+ * not set.
+ */
+ FileManager.prototype.getCurrentDirectoryEntry = function() {
+ return this.directoryModel_ &&
+ this.directoryModel_.getCurrentDirEntry();
+ };
+
FileManager.prototype.deleteSelection = function() {
// TODO(mtomasz): Remove this temporary dialog. crbug.com/167364
var entries = this.getSelection().entries;
@@ -2547,7 +2563,8 @@ DialogType.isModal = function(type) {
}
this.table_.list.endBatchUpdates();
this.grid_.endBatchUpdates();
- this.updateMiddleBarVisibility_();
+ if (util.platform.newUI())
+ this.updateMiddleBarVisibility_();
this.scanCompletedTimer_ = null;
}.bind(this), 50);
};
@@ -2580,7 +2597,8 @@ DialogType.isModal = function(type) {
this.hideSpinnerLater_();
this.table_.list.endBatchUpdates();
this.grid_.endBatchUpdates();
- this.updateMiddleBarVisibility_();
+ if (util.platform.newUI())
+ this.updateMiddleBarVisibility_();
this.scanUpdatedTimer_ = null;
}.bind(this), 200);
};
@@ -2609,7 +2627,8 @@ DialogType.isModal = function(type) {
this.scanInProgress_ = false;
this.table_.list.endBatchUpdates();
this.grid_.endBatchUpdates();
- this.updateMiddleBarVisibility_();
+ if (util.platform.newUI())
+ this.updateMiddleBarVisibility_();
}
};
« no previous file with comments | « chrome/browser/resources/file_manager/css/file_manager.css ('k') | chrome/browser/resources/file_manager/js/file_selection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698