Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable16] Always use the folder icon depending on the mount type if not a share mount #17155

Merged
merged 1 commit into from Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/files/js/mainfileinfodetailview.js
Expand Up @@ -186,6 +186,9 @@
this._previewManager.loadPreview(this.model, $iconDiv, $container);
} else {
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 + '")');
}
this.$el.find('[title]').tooltip({placement: 'bottom'});
Expand Down
2 changes: 1 addition & 1 deletion core/js/dist/share_backend.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/share_backend.js.map

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions core/js/share.js
Expand Up @@ -269,22 +269,23 @@ OC.Share = _.extend(OC.Share || {}, {
var message, recipients, avatars;
var ownerId = $tr.attr('data-share-owner-id');
var owner = $tr.attr('data-share-owner');
var mountType = $tr.attr('data-mounttype');
var shareFolderIcon;
var iconClass = 'icon-shared';
action.removeClass('shared-style');
// update folder icon
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');
}
else {
} else {
shareFolderIcon = OC.MimeType.getIconUrl('dir-shared');
}
$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');
$tr.attr('data-icon', shareFolderIcon);
} else if (type === 'dir') {
var isEncrypted = $tr.attr('data-e2eencrypted');
var mountType = $tr.attr('data-mounttype');
// FIXME: duplicate of FileList._createRow logic for external folder,
// need to refactor the icon logic into a single code path eventually
if (isEncrypted === 'true') {
Expand Down