diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-13 08:28:30 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-13 08:28:30 +0100 |
commit | c4aeb0b5b543de8f6e5e5296937ab81914e5cc7d (patch) | |
tree | 2a26e0c84562ddfc152ff3ecf7625a6d72c619d1 /apps/files/js | |
parent | 3ece0a7767e51082d89c549a742f0faed0b7eda5 (diff) | |
parent | ef1dd3ea0ae74a72f92ab1c6504cd24a2bd865c9 (diff) | |
download | nextcloud-server-c4aeb0b5b543de8f6e5e5296937ab81914e5cc7d.tar.gz nextcloud-server-c4aeb0b5b543de8f6e5e5296937ab81914e5cc7d.zip |
Merge pull request #13289 from owncloud/fav-keepfavoncancelrename
Properly update internal file info with updated tags
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/tagsplugin.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js index a6757431ffa..dec6063aa9b 100644 --- a/apps/files/js/tagsplugin.js +++ b/apps/files/js/tagsplugin.js @@ -110,10 +110,17 @@ dir + '/' + fileName, tags ).then(function(result) { + // response from server should contain updated tags + var newTags = result.tags; + if (_.isUndefined(newTags)) { + newTags = tags; + } + var fileInfo = context.fileList.files[$file.index()]; // read latest state from result - toggleStar($actionEl, (result.tags.indexOf(OC.TAG_FAVORITE) >= 0)); - $file.attr('data-tags', tags.join('|')); + toggleStar($actionEl, (newTags.indexOf(OC.TAG_FAVORITE) >= 0)); + $file.attr('data-tags', newTags.join('|')); $file.attr('data-favorite', !isFavorite); + fileInfo.tags = newTags; }); } }); |