diff --git a/src/Grid/Tools/QuickCreate.php b/src/Grid/Tools/QuickCreate.php index 799b71c154..66788cc8d6 100644 --- a/src/Grid/Tools/QuickCreate.php +++ b/src/Grid/Tools/QuickCreate.php @@ -248,7 +248,7 @@ protected function script() }); $('.quick-create .create-form').submit(function (e) { - + $(':submit', e.target).button('loading'); e.preventDefault(); $.ajax({ @@ -268,7 +268,9 @@ protected function script() $.admin.toastr.warning(data.message, '', {positionClass:"toast-top-center"}) } }, - error:function(XMLHttpRequest, textStatus){ + error: function(XMLHttpRequest, textStatus){ + $(':submit', e.target).button('reset'); + if (typeof XMLHttpRequest.responseJSON === 'object') { $.admin.toastr.error(XMLHttpRequest.responseJSON.message, '', {positionClass:"toast-top-center", timeOut: 10000}); }