Skip to content
Snippets Groups Projects
Unverified Commit 7149ed74 authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

Merge pull request #16976 from nextcloud/bugfix/noid/directory-icon-mount

Always use the folder icon depending on the mount type if not a share mount
parents 978d312e d1724cb6
No related branches found
No related tags found
No related merge requests found
...@@ -186,6 +186,9 @@ ...@@ -186,6 +186,9 @@
this._previewManager.loadPreview(this.model, $iconDiv, $container); this._previewManager.loadPreview(this.model, $iconDiv, $container);
} else { } else {
var iconUrl = this.model.get('icon') || OC.MimeType.getIconUrl('dir'); var iconUrl = this.model.get('icon') || OC.MimeType.getIconUrl('dir');
if (typeof this.model.get('mountType') !== 'undefined') {
iconUrl = OC.MimeType.getIconUrl('dir-' + this.model.get('mountType'))
}
$iconDiv.css('background-image', 'url("' + iconUrl + '")'); $iconDiv.css('background-image', 'url("' + iconUrl + '")');
} }
this.$el.find('[title]').tooltip({placement: 'bottom'}); this.$el.find('[title]').tooltip({placement: 'bottom'});
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -269,22 +269,23 @@ OC.Share = _.extend(OC.Share || {}, { ...@@ -269,22 +269,23 @@ OC.Share = _.extend(OC.Share || {}, {
var message, recipients, avatars; var message, recipients, avatars;
var ownerId = $tr.attr('data-share-owner-id'); var ownerId = $tr.attr('data-share-owner-id');
var owner = $tr.attr('data-share-owner'); var owner = $tr.attr('data-share-owner');
var mountType = $tr.attr('data-mounttype');
var shareFolderIcon; var shareFolderIcon;
var iconClass = 'icon-shared'; var iconClass = 'icon-shared';
action.removeClass('shared-style'); action.removeClass('shared-style');
// update folder icon // update folder icon
if (type === 'dir' && (hasShares || hasLink || ownerId)) { if (type === 'dir' && (hasShares || hasLink || ownerId)) {
if (hasLink) { if (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {
shareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType);
} else if (hasLink) {
shareFolderIcon = OC.MimeType.getIconUrl('dir-public'); shareFolderIcon = OC.MimeType.getIconUrl('dir-public');
} } else {
else {
shareFolderIcon = OC.MimeType.getIconUrl('dir-shared'); shareFolderIcon = OC.MimeType.getIconUrl('dir-shared');
} }
$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')'); $tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');
$tr.attr('data-icon', shareFolderIcon); $tr.attr('data-icon', shareFolderIcon);
} else if (type === 'dir') { } else if (type === 'dir') {
var isEncrypted = $tr.attr('data-e2eencrypted'); var isEncrypted = $tr.attr('data-e2eencrypted');
var mountType = $tr.attr('data-mounttype');
// FIXME: duplicate of FileList._createRow logic for external folder, // FIXME: duplicate of FileList._createRow logic for external folder,
// need to refactor the icon logic into a single code path eventually // need to refactor the icon logic into a single code path eventually
if (isEncrypted === 'true') { if (isEncrypted === 'true') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment