toggle back when the action was not performed
This commit is contained in:
parent
8e2b99c3a9
commit
12f835b198
|
@ -109,7 +109,9 @@
|
||||||
|
|
||||||
self.applyFileTags(
|
self.applyFileTags(
|
||||||
dir + '/' + fileName,
|
dir + '/' + fileName,
|
||||||
tags
|
tags,
|
||||||
|
$actionEl,
|
||||||
|
isFavorite
|
||||||
).then(function(result) {
|
).then(function(result) {
|
||||||
// response from server should contain updated tags
|
// response from server should contain updated tags
|
||||||
var newTags = result.tags;
|
var newTags = result.tags;
|
||||||
|
@ -157,8 +159,10 @@
|
||||||
*
|
*
|
||||||
* @param {String} fileName path to the file or folder to tag
|
* @param {String} fileName path to the file or folder to tag
|
||||||
* @param {Array.<String>} tagNames array of tag names
|
* @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);
|
var encodedPath = OC.encodePath(fileName);
|
||||||
while (encodedPath[0] === '/') {
|
while (encodedPath[0] === '/') {
|
||||||
encodedPath = encodedPath.substr(1);
|
encodedPath = encodedPath.substr(1);
|
||||||
|
@ -178,6 +182,7 @@
|
||||||
message = ': ' + response.responseJSON.message;
|
message = ': ' + response.responseJSON.message;
|
||||||
}
|
}
|
||||||
OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags') + message);
|
OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags') + message);
|
||||||
|
toggleStar($actionEl, isFavorite);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue