Commit 276b8f62 authored by Sasha Morrissey's avatar Sasha Morrissey Committed by Commit Bot

Fix icons for Team Drive Roots to match Directory Tree in Files App

on the RHS are correct (folders should look like team drives).

Test: Select the Team Drives grand root on the LHS, check the icons
Bug: 840206
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I2f48f9834f32c7a11f652ac01f377aacd5313413
Reviewed-on: https://chromium-review.googlesource.com/1046346Reviewed-by: default avatarNaoki Fukino <fukino@chromium.org>
Commit-Queue: Sasha Morrissey <sashab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557411}
parent c9145820
......@@ -42,6 +42,12 @@
url(../images/filetype/2x/filetype_folder_shared.png) 2x);
}
.team-drive-root[file-type-icon='folder'] {
background-image: -webkit-image-set(
url(../images/filetype/filetype_team_drive.png) 1x,
url(../images/filetype/2x/filetype_team_drive.png) 2x);
}
tree .tree-item[selected] > .tree-row > [file-type-icon='folder'] {
background-image: -webkit-image-set(
url(../images/filetype/filetype_folder_active.png) 1x,
......@@ -54,6 +60,13 @@ tree .tree-item[selected] > .tree-row > .shared[file-type-icon='folder'] {
url(../images/filetype/2x/filetype_folder_shared_active.png) 2x);
}
tree .tree-item[selected] > .tree-row >
.team-drive-root[file-type-icon='folder'] {
background-image: -webkit-image-set(
url(../images/filetype/filetype_team_drive_active.png) 1x,
url(../images/filetype/2x/filetype_team_drive_active.png) 2x);
}
/* TODO(fukino): Check if 'form' is in use, and remove this if possible. */
[file-type-icon='form'] {
background-image: -webkit-image-set(
......
......@@ -953,7 +953,8 @@ FileTable.prototype.updateListItemsMetadata = function(type, entries) {
filelist.updateListItemExternalProps(
listItem,
this.metadataModel_.getCache(
[entry], ['availableOffline', 'customIconUrl', 'shared'])[0]);
[entry], ['availableOffline', 'customIconUrl', 'shared'])[0],
util.isTeamDriveRoot(entry));
});
} else if (type === 'import-history') {
forEachCell('.table-row-cell > .status', function(item, entry, unused) {
......
......@@ -134,7 +134,8 @@ filelist.decorateListItem = function(li, entry, metadataModel) {
// not on an external backend, externalProps is not available.
var externalProps = metadataModel.getCache(
[entry], ['hosted', 'availableOffline', 'customIconUrl', 'shared'])[0];
filelist.updateListItemExternalProps(li, externalProps);
filelist.updateListItemExternalProps(
li, externalProps, util.isTeamDriveRoot(entry));
// Overriding the default role 'list' to 'listbox' for better
// accessibility on ChromeOS.
......@@ -199,8 +200,10 @@ filelist.renderFileNameLabel = function(doc, entry) {
* Updates grid item or table row for the externalProps.
* @param {cr.ui.ListItem} li List item.
* @param {Object} externalProps Metadata.
* @param {boolean} isTeamDriveRoot Whether the item is a team drive root entry.
*/
filelist.updateListItemExternalProps = function(li, externalProps) {
filelist.updateListItemExternalProps = function(
li, externalProps, isTeamDriveRoot) {
if (li.classList.contains('file')) {
if (externalProps.availableOffline)
li.classList.remove('dim-offline');
......@@ -220,8 +223,10 @@ filelist.updateListItemExternalProps = function(li, externalProps) {
else
iconDiv.style.backgroundImage = ''; // Back to the default image.
if (li.classList.contains('directory'))
if (li.classList.contains('directory')) {
iconDiv.classList.toggle('shared', !!externalProps.shared);
iconDiv.classList.toggle('team-drive-root', !!isTeamDriveRoot);
}
};
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment