[PATCH sherpa] [views] Drop buggy monkey-patch on add_onload

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Aug 25 13:04:05 CEST 2017


 cubicweb_sherpa/views/templates.py |  10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1503659030 -7200
#      Fri Aug 25 13:03:50 2017 +0200
# Node ID e8e564147f1bce197a25d8fe5578fc946a5782b5
# Parent  959dd18ff04429b87d01be4fafcdedb052ee2896
# Available At https://hg.logilab.org/review/cubes/sherpa
#              hg pull https://hg.logilab.org/review/cubes/sherpa -r e8e564147f1b
[views] Drop buggy monkey-patch on add_onload

this has been inadvertently copied from francearchive and has nasty side effect since
it also remove a wrapper that makes the js code called once the page is fully loaded.

diff --git a/cubicweb_sherpa/views/templates.py b/cubicweb_sherpa/views/templates.py
--- a/cubicweb_sherpa/views/templates.py
+++ b/cubicweb_sherpa/views/templates.py
@@ -27,20 +27,10 @@ from . import jinja_render
 
 # Bootstrap configuration.
 basetemplates.TheMainTemplate.twbs_container_cls = 'container-fluid'
 
 
- at monkeypatch(HTMLHead)
-def add_onload(self, jscode):
-    """original `add_onload` implementation use `$(cw)`
-    but `cw` variable is not available
-    in francearchive, use `$` instead"""
-    self.add_post_inline_script(u"""$(function() {
-  %s
-});""" % jscode)
-
-
 def render_component(comp):
     stream = UStringIO()
     w = stream.write
     comp.render(w)
     return stream.getvalue()


More information about the saem-devel mailing list