[forms] add setFormsTarget() to the list of postAjaxLoad callbacks to have iframe on ajax-rendered forms
--- a/web/data/cubicweb.ajax.js Mon Nov 16 17:18:48 2009 +0100
+++ b/web/data/cubicweb.ajax.js Mon Nov 16 17:20:03 2009 +0100
@@ -62,6 +62,9 @@
if (typeof roundedCorners != 'undefined') {
roundedCorners(node);
}
+ if (typeof setFormsTarget != 'undefined') {
+ setFormsTarget(node);
+ }
loadDynamicFragments(node);
// XXX simulates document.ready, but the former
// only runs once, this one potentially many times
--- a/web/data/cubicweb.edition.js Mon Nov 16 17:18:48 2009 +0100
+++ b/web/data/cubicweb.edition.js Mon Nov 16 17:20:03 2009 +0100
@@ -416,8 +416,9 @@
* NOTE3: there is a XHTML module allowing iframe elements but there
* is still the problem of the form's `target` attribute
*/
-function setFormsTarget() {
- jQuery('form.entityForm').each(function () {
+function setFormsTarget(node) {
+ var $node = jQuery(node || document.body);
+ $node.find('form.entityForm').each(function () {
var form = jQuery(this);
var target = form.attr('cubicweb:target');
if (target) {
@@ -431,7 +432,7 @@
});
}
-jQuery(document).ready(setFormsTarget);
+jQuery(document).ready(function() {setFormsTarget();});
/*