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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/preview_panel.js

Issue 468913005: Show no information on the preview panel when no item is selected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js b/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
index 0e0eabe979550cb2df57edfd0171eb17c2d99e29..119e8ba8419e42908e7f2fb058b03a16bbcc91d1 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
@@ -241,23 +241,28 @@ PreviewPanel.prototype.updatePreviewArea_ = function() {
return;
var selection = this.selection_;
- // Update thumbnails.
- this.thumbnails.selection = selection.totalCount !== 0 ?
- selection : {entries: [this.currentEntry_]};
-
- // Check if the breadcrumb list should show instead on the preview text.
- var entry;
- if (this.selection_.totalCount == 1)
- entry = this.selection_.entries[0];
- if (this.selection_.totalCount <= 1)
+ // If no item is selected, no information is displayed on the footer.
+ if (selection.totalCount === 0) {
+ this.thumbnails.hidden = true;
this.calculatingSizeLabel_.hidden = true;
+ this.previewText_.textContent = '';
+ return;
+ }
- if (entry) {
+ // If one item is selected, show thumbnail and entry name of the item.
+ if (selection.totalCount === 1) {
+ this.thumbnails.hidden = false;
+ this.thumbnails.selection = selection;
+ this.calculatingSizeLabel_.hidden = true;
this.previewText_.textContent = util.getEntryLabel(
- this.volumeManager_, entry);
+ this.volumeManager_, selection.entries[0]);
return;
}
+ // Update thumbnails.
+ this.thumbnails.hidden = false;
+ this.thumbnails.selection = selection;
+
// Obtains the preview text.
var text;
if (selection.directoryCount == 0)
@@ -403,6 +408,14 @@ PreviewPanel.Thumbnails.prototype = {
set selection(value) {
this.sequence_++;
this.loadThumbnails_(value);
+ },
+
+ /**
+ * Set visibility of the thumbnails.
+ * @param {boolean} hidden Whether to hide the thumbnails or not.
+ */
+ set hidden(value) {
+ this.element_.hidden = value;
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698