Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
felixheidecke committed Oct 23, 2019
1 parent b25b6d5 commit 416a36b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,8 @@
this.updateEmptyContent();
}

this._setSharedIcon()

return $tr;
},

Expand Down Expand Up @@ -1484,6 +1486,8 @@
self.changeDirectory(currentDir, true);
}
});

this._setSharedIcon()
},
linkTo: function(dir) {
return OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent(dir).replace(/%2F/g, '/');
Expand Down Expand Up @@ -1805,6 +1809,37 @@
return Promise.all(crumbs)
},


_chechPathHasShares: function() {
let self = this;

return this.getPathShareInfo(this.getCurrentDirectory()).then(function(path) {

let sharedFolders = _.filter(path, function(dir) {
return dir.shareTypes.length > 0
})

if (sharedFolders.length > 0)
return true

return false
})
},

_setSharedIcon: function() {
var self = this;
setTimeout(function(){
// Sad, but there is no ready callback
// so let's do it this way 4 now.

self._chechPathHasShares().then(function(e) {
if (e) {
$('tr[data-type="dir"] .thumbnail').css({'backgroundImage' : 'url(' + OC.MimeType.getIconUrl('dir-shared') + ')'})
}
})
}, 250)
},

/**
* Generates a preview URL based on the URL space.
* @param urlSpec attributes for the URL
Expand Down

0 comments on commit 416a36b

Please sign in to comment.