fixed 1756:scripts/sessions2trash.py doesn't work with 'separate=True', thanks Paolo Valleri

This commit is contained in:
Massimo
2013-11-07 10:25:29 -06:00
parent ee1de04544
commit e6f84c45b9
4 changed files with 19 additions and 19 deletions
+8 -8
View File
@@ -250,22 +250,20 @@
});
},
trap_form: function (action, target) {
/* traps any LOADed form */
$('#' + target + ' form').each(function (i) {
var form = $(this);
if(form.hasClass('no_trap')) {
if (form.hasClass('no_trap')) {
return;
}
form.attr('data-w2p_target', target);
var url;
var url = form.attr('action');
if(form.hasClass('trap_use_form_action')) {
/* submit using form own action, instead of component url */
url = form.attr('action');
} else {
/* should be there by default */
if ((url === "") || (url === "#")) {
/* form has no action. Use component url. */
url = action;
}
@@ -275,8 +273,10 @@
web2py.ajax_page('post', url, form.serialize(), target, form);
e.preventDefault();
});
});
});
},
ajax_page: function (method, action, data, target, element) {
/* element is a new parameter, but should be put be put in front */
if(element == undefined) element = $(document);