summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-01-26 12:01:07 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-02-02 11:17:55 +0100
commit12f835b1981ecfbfb99687b9f61294653a9863bc (patch)
treeb49c396f8a0b17441ca974075f3bcc4764ecc7fc /apps
parent8e2b99c3a964d5eef174c068919ce7a941266cf1 (diff)
downloadnextcloud-server-12f835b1981ecfbfb99687b9f61294653a9863bc.tar.gz
nextcloud-server-12f835b1981ecfbfb99687b9f61294653a9863bc.zip
toggle back when the action was not performed
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/tagsplugin.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js
index b81f1ec5756..293e25176f3 100644
--- a/apps/files/js/tagsplugin.js
+++ b/apps/files/js/tagsplugin.js
@@ -109,7 +109,9 @@
self.applyFileTags(
dir + '/' + fileName,
- tags
+ tags,
+ $actionEl,
+ isFavorite
).then(function(result) {
// response from server should contain updated tags
var newTags = result.tags;
@@ -157,8 +159,10 @@
*
* @param {String} fileName path to the file or folder to tag
* @param {Array.<String>} tagNames array of tag names
+ * @param {Object} $actionEl element
+ * @param {boolean} isFavorite Was the item favorited before
*/
- applyFileTags: function(fileName, tagNames) {
+ applyFileTags: function(fileName, tagNames, $actionEl, isFavorite) {
var encodedPath = OC.encodePath(fileName);
while (encodedPath[0] === '/') {
encodedPath = encodedPath.substr(1);
@@ -178,6 +182,7 @@
message = ': ' + response.responseJSON.message;
}
OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags') + message);
+ toggleStar($actionEl, isFavorite);
});
}
};