From a823485638256f30e52c46e92b35b53331a7c321 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 11 Feb 2016 11:06:26 +0100 Subject: [PATCH] Reload list of shares on directory change --- apps/files_sharing/js/share.js | 4 ++++ core/js/share.js | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index f8d89828f4..0a01c5af0a 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -122,6 +122,10 @@ } }); + fileList.$el.on('changeDirectory', function() { + OCA.Sharing.sharesLoaded = false; + }); + fileActions.registerAction({ name: 'Share', displayName: '', diff --git a/core/js/share.js b/core/js/share.js index b2c1bd5de1..9539e92e09 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -50,12 +50,18 @@ OC.Share = _.extend(OC.Share || {}, { * @param callback function to call after the shares were loaded */ loadIcons:function(itemType, fileList, callback) { + var path = fileList.dirInfo.path; + if (path === '/') { + path = ''; + } + path += '/' + fileList.dirInfo.name; + // Load all share icons $.get( OC.linkToOCS('apps/files_sharing/api/v1', 2) + 'shares', { subfiles: 'true', - path: fileList.dirInfo.path, + path: path, format: 'json' }, function(result) { if (result && result.ocs.meta.statuscode === 200) {