Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-01-26 13:27:51 +0300
committerJoas Schilling <nickvergessen@gmx.de>2015-02-02 13:17:54 +0300
commit8e2b99c3a964d5eef174c068919ce7a941266cf1 (patch)
tree60e0ee29defb7be74d702138db842de976ea623e /apps/files/js/tagsplugin.js
parentdf75a6e5f37d4dbd1fe6abc0cdfb27037ffd1c99 (diff)
fix response for tags and show error message
Diffstat (limited to 'apps/files/js/tagsplugin.js')
-rw-r--r--apps/files/js/tagsplugin.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js
index b00aacfba57..b81f1ec5756 100644
--- a/apps/files/js/tagsplugin.js
+++ b/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,8 +171,13 @@
}),
dataType: 'json',
type: 'POST'
- }).fail(function() {
- OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags'));
+ }).fail(function(response) {
+ var message = '';
+ // show message if it is available
+ if(response.responseJSON && response.responseJSON.message) {
+ message = ': ' + response.responseJSON.message;
+ }
+ OC.Notification.showTemporary(t('files', 'An error occurred while trying to update the tags') + message);
});
}
};