--- a/utils.py Fri Jul 03 17:58:36 2009 +0200
+++ b/utils.py Fri Jul 03 18:00:07 2009 +0200
@@ -206,8 +206,13 @@
def add_post_inline_script(self, content):
self.post_inlined_scripts.append(content)
- def add_onload(self, jscode):
- self.add_post_inline_script(u"""jQuery(document).ready(function () {
+ def add_onload(self, jscode, jsoncall=False):
+ if jsoncall:
+ self.add_post_inline_script(u"""jQuery(CubicWeb).bind('ajax-loaded', function(event) {
+%s
+});""" % jscode)
+ else:
+ self.add_post_inline_script(u"""jQuery(document).ready(function () {
%s
});""" % jscode)