remove datatype=json from submit api method

This commit is contained in:
vitalets
2012-12-07 17:58:42 +04:00
parent 45122fb1c5
commit da910f5d94
2 changed files with 31 additions and 29 deletions
src/element
test/unit

@ -449,22 +449,13 @@ Makes editable any HTML element on the page. Applied as jQuery method.
$.ajax($.extend({
url: config.url,
data: values,
type: 'POST',
dataType: 'json'
type: 'POST'
}, config.ajaxOptions))
.success(function(response) {
//successful response
if(typeof response === 'object' && response.id) {
$elems.editable('option', 'pk', response.id);
$elems.removeClass('editable-unsaved');
if(typeof config.success === 'function') {
config.success.apply($elems, arguments);
}
} else { //server-side validation error
if(typeof config.error === 'function') {
config.error.apply($elems, arguments);
}
}
if(typeof config.success === 'function') {
config.success.apply($elems, arguments);
}
})
.error(function(){ //ajax error
if(typeof config.error === 'function') {