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

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

Issue 1823763006: Files app: Increase information in details panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: ui/file_manager/file_manager/foreground/js/ui/single_file_details.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/single_file_details.js b/ui/file_manager/file_manager/foreground/js/ui/single_file_details.js
index 035b04c886ec24e9dd286dedb57bceaa5592c249..da79029d23ffa893788821685c2a9515547439ec 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/single_file_details.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/single_file_details.js
@@ -211,25 +211,32 @@ SingleFileDetailsPanel.prototype = {
*/
setDetails_: function(entry, item) {
var elem;
- // Modification Time
- elem = queryRequiredElement('.modification-time', this.list_);
- if (item.modificationTime) {
- elem.classList.toggle('available', true);
- queryRequiredElement('.content', elem).textContent =
- this.formatter_.formatModDate(item.modificationTime);
- } else {
- elem.classList.toggle('available', false);
- }
- // Filesize
- elem = queryRequiredElement('.file-size', this.list_);
- if (item.size) {
- elem.classList.toggle('available', true);
- queryRequiredElement('.content', elem).textContent =
- this.formatter_.formatSize(item.size, item.hosted);
- } else {
- elem.classList.toggle('available', false);
- }
- // TODO(ryoh): Display more and more details...
+ var self = this;
+ var update = function(query, cond, thunk) {
+ var elem = queryRequiredElement(query, self.list_);
+ if (cond) {
+ elem.classList.toggle('available', true);
+ queryRequiredElement('.content', elem).textContent = thunk();
+ } else {
+ elem.classList.toggle('available', false);
+ }
+ };
+ update('.modification-time', item.modificationTime, function() {
+ return self.formatter_.formatModDate(item.modificationTime);
+ });
+ update('.file-size', item.size, function() {
+ return self.formatter_.formatSize(item.size, item.hosted);
+ });
+ update('.image-size', item.imageWidth && item.imageHeight, function() {
+ return item.imageWidth.toString()+"x"+item.imageHeight;
+ });
+ update('.media-title', item.mediaTitle, function() {
+ return item.mediaTitle;
+ });
+ update('.media-artist', item.mediaArtist, function() {
+ return item.mediaArtist;
+ });
+ // TODO(ryoh): Should we display more and more items?
},
/**
* Called when visibility of this panel is changed.
@@ -256,8 +263,6 @@ SingleFileDetailsPanel.prototype = {
* @const
*/
SingleFileDetailsPanel.LOADING_ITEMS = [
- 'availableOffline',
- 'availableWhenMetered',
'croppedThumbnailUrl',
'customIconUrl',
'dirty',
@@ -270,10 +275,6 @@ SingleFileDetailsPanel.LOADING_ITEMS = [
'mediaMimeType',
'mediaTitle',
'modificationTime',
- 'pinned',
- 'present',
- 'shared',
- 'sharedWithMe',
'size',
'thumbnailUrl'
];
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc ('k') | ui/file_manager/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698