utils.py
branchstable
changeset 2258 79bc598c6411
parent 2009 b1e2b9e4c809
child 2332 b04d80f19075
--- 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)