Merge branch 'master' of ssh://git.cuchulu.com/paramecio/jsutils
: i
This commit is contained in:
commit
598d59c129
2 changed files with 23 additions and 4 deletions
|
|
@ -210,7 +210,7 @@ $=jQuery;
|
|||
|
||||
after_list=options.after_list;
|
||||
|
||||
after_list();
|
||||
after_list(data.rows);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
21
posting2.js
21
posting2.js
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
$=jQuery;
|
||||
|
||||
(function( $ ){
|
||||
|
||||
|
|
@ -58,6 +58,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
beforeSend=false;
|
||||
|
||||
if(options.hasOwnProperty("before_send")) {
|
||||
|
||||
beforeSend=options.before_send;
|
||||
console.log('Send before...');
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(this).on('submit', function (e) {
|
||||
|
||||
//Get data of form
|
||||
|
|
@ -108,6 +118,7 @@
|
|||
cache:false,
|
||||
contentType:false,
|
||||
processData: false,
|
||||
beforeSend: beforeSend,
|
||||
success: function (data) {
|
||||
|
||||
$(options.loading).hide();
|
||||
|
|
@ -117,6 +128,12 @@
|
|||
if(!data.hasOwnProperty("error_csrf"))
|
||||
{
|
||||
|
||||
if(options.hasOwnProperty("error")) {
|
||||
|
||||
options.error(data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(data.hasOwnProperty("csrf_token"))
|
||||
{
|
||||
|
|
@ -130,6 +147,8 @@
|
|||
|
||||
if(data.hasOwnProperty('error_form'))
|
||||
{
|
||||
console.log('Showing errors in form...');
|
||||
|
||||
for(i in data.error_form) {
|
||||
|
||||
$(i).html(data.error_form[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue