summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-07-01 21:32:04 +0200
committerVincent Petry <pvince81@owncloud.com>2014-07-01 21:32:04 +0200
commit025b71d068bf530581693af67a31a56dca24beb1 (patch)
tree1d3aeda7b7f569b02adf96399896b1a59c307913 /core
parent509cdebab7bb99c34467b053a2e596f48a10399d (diff)
downloadnextcloud-server-025b71d068bf530581693af67a31a56dca24beb1.tar.gz
nextcloud-server-025b71d068bf530581693af67a31a56dca24beb1.zip
Use fileActionsReady to re-render sharing icons
Whenever file actions are modified, either by registering new actions or when appending a new page of entries, the sharing app is now notified so it can correctly refresh the sharing icon status. Additionally, the core's loadIcons() method is also used to load the existing shares and also refresh the sharing icons afterwards.
Diffstat (limited to 'core')
-rw-r--r--core/js/share.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/js/share.js b/core/js/share.js
index 5763664c5de..62271a43ceb 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -29,10 +29,13 @@ OC.Share={
* files "Share" icon to "Shared" according to their share status and
* share type.
*
+ * If a callback is specified, the update step is skipped.
+ *
* @param itemType item type
* @param fileList file list instance, defaults to OCA.Files.App.fileList
+ * @param callback function to call after the shares were loaded
*/
- loadIcons:function(itemType, fileList) {
+ loadIcons:function(itemType, fileList, callback) {
// Load all share icons
$.get(
OC.filePath('core', 'ajax', 'share.php'),
@@ -45,7 +48,11 @@ OC.Share={
$.each(result.data, function(item, data) {
OC.Share.statuses[item] = data;
});
- OC.Share.updateIcons(itemType, fileList);
+ if (_.isFunction(callback)) {
+ callback(OC.Share.statuses);
+ } else {
+ OC.Share.updateIcons(itemType, fileList);
+ }
}
}
);