]> source.dussan.org Git - nextcloud-server.git/commitdiff
toggle back when the action was not performed
authorJoas Schilling <nickvergessen@gmx.de>
Mon, 26 Jan 2015 11:01:07 +0000 (12:01 +0100)
committerJoas Schilling <nickvergessen@gmx.de>
Mon, 2 Feb 2015 10:17:55 +0000 (11:17 +0100)
apps/files/js/tagsplugin.js

index b81f1ec575618e49f6eaf712e05bd549fc6799b0..293e25176f3c17238fcc234db02750068c036904 100644 (file)
 
                                        self.applyFileTags(
                                                dir + '/' + fileName,
-                                               tags
+                                               tags,
+                                               $actionEl,
+                                               isFavorite
                                        ).then(function(result) {
                                                // response from server should contain updated tags
                                                var newTags = result.tags;
                 *
                 * @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);
                                        message = ': ' + response.responseJSON.message;
                                }
                                OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags') + message);
+                               toggleStar($actionEl, isFavorite);
                        });
                }
        };