removed the callback if false
This commit is contained in:
parent
07df697618
commit
7c1db136b1
|
@ -8,7 +8,7 @@ class bluditAjax {
|
||||||
ajaxRequest.abort();
|
ajaxRequest.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (content.length<100) {
|
if ((content.length<100) && callBack) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,12 +25,16 @@ class bluditAjax {
|
||||||
|
|
||||||
ajaxRequest.done(function (response, textStatus, jqXHR) {
|
ajaxRequest.done(function (response, textStatus, jqXHR) {
|
||||||
console.log("Bludit AJAX: autosave(): done handler");
|
console.log("Bludit AJAX: autosave(): done handler");
|
||||||
callBack("Autosave success");
|
if (callBack) {
|
||||||
|
callBack("Autosave success");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxRequest.fail(function (jqXHR, textStatus, errorThrown) {
|
ajaxRequest.fail(function (jqXHR, textStatus, errorThrown) {
|
||||||
console.log("Bludit AJAX: autosave(): fail handler");
|
console.log("Bludit AJAX: autosave(): fail handler");
|
||||||
callBack("Autosave failure");
|
if (callBack) {
|
||||||
|
callBack("Autosave failure");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxRequest.always(function () {
|
ajaxRequest.always(function () {
|
||||||
|
|
Loading…
Reference in New Issue