utils.py
branchstable
changeset 2258 79bc598c6411
parent 2009 b1e2b9e4c809
child 2332 b04d80f19075
equal deleted inserted replaced
2257:2c9eceeaae6a 2258:79bc598c6411
   204         self.jsvars.append( (var, value) )
   204         self.jsvars.append( (var, value) )
   205 
   205 
   206     def add_post_inline_script(self, content):
   206     def add_post_inline_script(self, content):
   207         self.post_inlined_scripts.append(content)
   207         self.post_inlined_scripts.append(content)
   208 
   208 
   209     def add_onload(self, jscode):
   209     def add_onload(self, jscode, jsoncall=False):
   210         self.add_post_inline_script(u"""jQuery(document).ready(function () {
   210         if jsoncall:
       
   211             self.add_post_inline_script(u"""jQuery(CubicWeb).bind('ajax-loaded', function(event) {
       
   212 %s
       
   213 });""" % jscode)
       
   214         else:
       
   215             self.add_post_inline_script(u"""jQuery(document).ready(function () {
   211  %s
   216  %s
   212  });""" % jscode)
   217  });""" % jscode)
   213 
   218 
   214 
   219 
   215     def add_js(self, jsfile):
   220     def add_js(self, jsfile):