Skip to content

Commit 7149ed7

Browse files
authored
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
2 parents 978d312 + d1724cb commit 7149ed7

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

apps/files/js/mainfileinfodetailview.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
this._previewManager.loadPreview(this.model, $iconDiv, $container);
187187
} else {
188188
var iconUrl = this.model.get('icon') || OC.MimeType.getIconUrl('dir');
189+
if (typeof this.model.get('mountType') !== 'undefined') {
190+
iconUrl = OC.MimeType.getIconUrl('dir-' + this.model.get('mountType'))
191+
}
189192
$iconDiv.css('background-image', 'url("' + iconUrl + '")');
190193
}
191194
this.$el.find('[title]').tooltip({placement: 'bottom'});

core/js/dist/share_backend.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/js/dist/share_backend.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/js/share.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,22 +269,23 @@ OC.Share = _.extend(OC.Share || {}, {
269269
var message, recipients, avatars;
270270
var ownerId = $tr.attr('data-share-owner-id');
271271
var owner = $tr.attr('data-share-owner');
272+
var mountType = $tr.attr('data-mounttype');
272273
var shareFolderIcon;
273274
var iconClass = 'icon-shared';
274275
action.removeClass('shared-style');
275276
// update folder icon
276277
if (type === 'dir' && (hasShares || hasLink || ownerId)) {
277-
if (hasLink) {
278+
if (typeof mountType !== 'undefined' && mountType !== 'shared-root' && mountType !== 'shared') {
279+
shareFolderIcon = OC.MimeType.getIconUrl('dir-' + mountType);
280+
} else if (hasLink) {
278281
shareFolderIcon = OC.MimeType.getIconUrl('dir-public');
279-
}
280-
else {
282+
} else {
281283
shareFolderIcon = OC.MimeType.getIconUrl('dir-shared');
282284
}
283285
$tr.find('.filename .thumbnail').css('background-image', 'url(' + shareFolderIcon + ')');
284286
$tr.attr('data-icon', shareFolderIcon);
285287
} else if (type === 'dir') {
286288
var isEncrypted = $tr.attr('data-e2eencrypted');
287-
var mountType = $tr.attr('data-mounttype');
288289
// FIXME: duplicate of FileList._createRow logic for external folder,
289290
// need to refactor the icon logic into a single code path eventually
290291
if (isEncrypted === 'true') {

0 commit comments

Comments
 (0)