# HG changeset patch # User Adrien Di Mascio # Date 1258388403 -3600 # Node ID fe22502d4ab1f16d2ba3f97d79d9b585735ee080 # Parent 4908c7156eabde4406b9992a4a1ada8fe5c36861 [forms] add setFormsTarget() to the list of postAjaxLoad callbacks to have iframe on ajax-rendered forms diff -r 4908c7156eab -r fe22502d4ab1 web/data/cubicweb.ajax.js --- 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 diff -r 4908c7156eab -r fe22502d4ab1 web/data/cubicweb.edition.js --- 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();}); /*