Do not update action icon recipients for file list

Since the files app doesn't have the recipient information on load it
cannot initially render the recipients in the action icons.

For this reason the action icon will not be updated with the recipients
after changing the shares, for consistency.
This commit is contained in:
Vincent Petry 2014-06-04 10:48:01 +02:00
parent 07f1b263c9
commit af6a65cbf3
1 changed files with 5 additions and 0 deletions

View File

@ -115,6 +115,11 @@
OC.Share.showDropDown(itemType, $tr.data('id'), appendTo, true, possiblePermissions, filename);
}
$('#dropdown').on('sharesChanged', function(ev) {
// files app current cannot show recipients on load, so we don't update the
// icon when changed for consistency
if (context.fileList.$el.closest('#app-content-files').length) {
return;
}
var recipients = _.pluck(ev.shares[OC.Share.SHARE_TYPE_USER], 'share_with_displayname');
var groupRecipients = _.pluck(ev.shares[OC.Share.SHARE_TYPE_GROUP], 'share_with_displayname');
recipients = recipients.concat(groupRecipients);