diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-08-17 12:25:58 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-26 13:38:12 +0200 |
commit | 17a31a51c62e36500f59b3c2d385ab79258f6bb6 (patch) | |
tree | d73fc6bb6a326cc34832c963bcda26e7417f35e1 /apps/files_sharing/js/share.js | |
parent | 5b5c3a1773dab4960d41aafc4150859a308311b7 (diff) | |
download | nextcloud-server-17a31a51c62e36500f59b3c2d385ab79258f6bb6.tar.gz nextcloud-server-17a31a51c62e36500f59b3c2d385ab79258f6bb6.zip |
Fix share indicator handling
Properly update the fileInfoModel with the updated share types, which
also updates the file list row indicator properly
Diffstat (limited to 'apps/files_sharing/js/share.js')
-rw-r--r-- | apps/files_sharing/js/share.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index c40ca07b76b..5cd04ece446 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -189,13 +189,16 @@ // remove icon, if applicable OC.Share.markFileAsShared($tr, false, false); } - var newIcon = $tr.attr('data-icon'); - // in case markFileAsShared decided to change the icon, - // we need to modify the model - // (FIXME: yes, this is hacky) - if (fileInfoModel.get('icon') !== newIcon) { - fileInfoModel.set('icon', newIcon); - } + + // FIXME: this is too convoluted. We need to get rid of the above updates + // and only ever update the model and let the events take care of rerendering + fileInfoModel.set({ + shareTypes: shareModel.getShareTypes(), + // in case markFileAsShared decided to change the icon, + // we need to modify the model + // (FIXME: yes, this is hacky) + icon: $tr.attr('data-icon') + }); }); fileList.registerTabView(shareTab); |