JsonController: only return an ajaxHtmlHead div if extra resources are needed tls-sprint
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Wed, 18 Feb 2009 16:02:44 +0100
branchtls-sprint
changeset 808 8d739f6e8ef5
parent 807 e3cabbdd172a
child 809 31962f99770b
JsonController: only return an ajaxHtmlHead div if extra resources are needed
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Wed Feb 18 15:59:09 2009 +0100
+++ b/web/views/basecontrollers.py	Wed Feb 18 16:02:44 2009 +0100
@@ -239,9 +239,10 @@
                 stream.write(u'<div id="contentmain">')
         view.dispatch()
         extresources = req.html_headers.getvalue(skiphead=True)
-        stream.write(u'<div class="ajaxHtmlHead">\n') # XXX use a widget ?
-        stream.write(extresources)
-        stream.write(u'</div>\n')
+        if extresources:
+            stream.write(u'<div class="ajaxHtmlHead">\n') # XXX use a widget ?
+            stream.write(extresources)
+            stream.write(u'</div>\n')
         if req.form.get('paginate') and divid == 'pageContent':
             stream.write(u'</div></div>')
         source = stream.getvalue()