summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/share.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-08-17 12:25:58 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-26 13:38:12 +0200
commit17a31a51c62e36500f59b3c2d385ab79258f6bb6 (patch)
treed73fc6bb6a326cc34832c963bcda26e7417f35e1 /apps/files_sharing/js/share.js
parent5b5c3a1773dab4960d41aafc4150859a308311b7 (diff)
downloadnextcloud-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.js17
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);