[javascript] use jQuery.one('ajax-loaded') instead of jQuery.bind() in add_onload to avoid multiple callback executions stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 10 Mar 2010 12:19:55 +0100
branchstable
changeset 4859 f65208c9dbdc
parent 4858 8c886610e5ee
child 4860 cedb6afdb7da
[javascript] use jQuery.one('ajax-loaded') instead of jQuery.bind() in add_onload to avoid multiple callback executions
utils.py
--- a/utils.py	Wed Mar 10 12:08:45 2010 +0100
+++ b/utils.py	Wed Mar 10 12:19:55 2010 +0100
@@ -168,7 +168,7 @@
 
     def add_onload(self, jscode, jsoncall=False):
         if jsoncall:
-            self.add_post_inline_script(u"""jQuery(CubicWeb).bind('ajax-loaded', function(event) {
+            self.add_post_inline_script(u"""jQuery(CubicWeb).one('ajax-loaded', function(event) {
 %s
 });""" % jscode)
         else: