# HG changeset patch # User Adrien Di Mascio # Date 1268219995 -3600 # Node ID f65208c9dbdc5fb0af034d841ea28b79256e239d # Parent 8c886610e5eeedbde0803daf9caaa50188eee0fc [javascript] use jQuery.one('ajax-loaded') instead of jQuery.bind() in add_onload to avoid multiple callback executions diff -r 8c886610e5ee -r f65208c9dbdc 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: