Browse Source

Only update favorite icon if the operation was successful

Also shows a notification in case an error occured on updating the tags
remotes/origin/log-external-deletes
Joas Schilling 11 years ago
parent
commit
df75a6e5f3
  1. 4
      apps/files/js/tagsplugin.js

4
apps/files/js/tagsplugin.js

@ -105,12 +105,12 @@
} else {
tags.push(OC.TAG_FAVORITE);
}
toggleStar($actionEl, !isFavorite);
self.applyFileTags(
dir + '/' + fileName,
tags
).then(function(result) {
toggleStar($actionEl, !isFavorite);
// response from server should contain updated tags
var newTags = result.tags;
if (_.isUndefined(newTags)) {
@ -171,6 +171,8 @@
}),
dataType: 'json',
type: 'POST'
}).fail(function() {
OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags'));
});
}
};

Loading…
Cancel
Save