if (response.href) {
$(this).editable('option', 'url', response.href);
}
+ if ($(this).attr('data-name')) {
+ var textileAttr = $(this).attr('data-name') + 'Textile';
+ if (response[textileAttr]) {
+ $(this).attr('data-textile', response[textileAttr]);
+ }
+ }
return;
},
error: function(response, newValue) {
- return response.responseJSON.errors.join();
+ var errlist = response.responseJSON.errors;
+ var errmsg;
+ if (Array.isArray(errlist)) {
+ errmsg = errlist.join();
+ } else {
+ errmsg = ("The server returned an error when making " +
+ "this update (status " + response.status +
+ ": " + errlist + ").");
+ }
+ return errmsg;
}
}).
on('hidden', function(e, reason) {
// information if it appears elsewhere on the page.
if (reason != 'save') return;
var html = $(this).html();
+ if( $(this).attr('data-textile') ) {
+ html = $(this).attr('data-textile');
+ $(this).html(html);
+ }
var uuid = $(this).attr('data-object-uuid');
var attr = $(this).attr('data-name');
var edited = this;