mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-11-23 18:56:04 +00:00
Не добавлять комментарий, если с сервера пришло {"error":"SomeError"}
This commit is contained in:
parent
ad5ace57cb
commit
ec6eb34e22
|
@ -139,8 +139,9 @@ AjaxCommentProcessor.prototype.onSuccess = function(data, textStatus) {
|
||||||
var $textarea = this._$textarea;
|
var $textarea = this._$textarea;
|
||||||
|
|
||||||
if (textStatus === 'success') {
|
if (textStatus === 'success') {
|
||||||
this.hideForm();
|
if (data.error) {
|
||||||
|
this.onError(null, null, data.error);
|
||||||
|
} else {
|
||||||
// Creating the comment HTML
|
// Creating the comment HTML
|
||||||
create_comment_elements({
|
create_comment_elements({
|
||||||
id: data.comment_id,
|
id: data.comment_id,
|
||||||
|
@ -151,10 +152,13 @@ AjaxCommentProcessor.prototype.onSuccess = function(data, textStatus) {
|
||||||
fadeOut: true
|
fadeOut: true
|
||||||
}, this.insertComment.bind(this));
|
}, this.insertComment.bind(this));
|
||||||
|
|
||||||
|
this.hideForm();
|
||||||
|
|
||||||
// Cleaning textarea
|
// Cleaning textarea
|
||||||
$textarea.val('');
|
$textarea.val('');
|
||||||
this.setProgress(false);
|
this.setProgress(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue