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=options.after_list;
|
||||||
|
|
||||||
after_list();
|
after_list(data.rows);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
25
posting2.js
25
posting2.js
|
|
@ -1,4 +1,4 @@
|
||||||
|
$=jQuery;
|
||||||
|
|
||||||
(function( $ ){
|
(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) {
|
$(this).on('submit', function (e) {
|
||||||
|
|
||||||
//Get data of form
|
//Get data of form
|
||||||
|
|
@ -108,6 +118,7 @@
|
||||||
cache:false,
|
cache:false,
|
||||||
contentType:false,
|
contentType:false,
|
||||||
processData: false,
|
processData: false,
|
||||||
|
beforeSend: beforeSend,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|
||||||
$(options.loading).hide();
|
$(options.loading).hide();
|
||||||
|
|
@ -116,6 +127,12 @@
|
||||||
|
|
||||||
if(!data.hasOwnProperty("error_csrf"))
|
if(!data.hasOwnProperty("error_csrf"))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(options.hasOwnProperty("error")) {
|
||||||
|
|
||||||
|
options.error(data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(data.hasOwnProperty("csrf_token"))
|
if(data.hasOwnProperty("csrf_token"))
|
||||||
|
|
@ -129,9 +146,11 @@
|
||||||
console.log('Error');
|
console.log('Error');
|
||||||
|
|
||||||
if(data.hasOwnProperty('error_form'))
|
if(data.hasOwnProperty('error_form'))
|
||||||
{
|
{
|
||||||
|
console.log('Showing errors in form...');
|
||||||
|
|
||||||
for(i in data.error_form) {
|
for(i in data.error_form) {
|
||||||
|
|
||||||
$(i).html(data.error_form[i]);
|
$(i).html(data.error_form[i]);
|
||||||
$(i).show();
|
$(i).show();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue