fix in facets (avoid to have an horizontal space between facets when facets are unfold)
authorStephanie Marcu <stephanie.marcu@logilab.fr>
Wed, 25 Feb 2009 09:30:30 +0100
changeset 949 1fba39d6ee70
parent 948 c95ce9b38168
child 950 8ac01018f499
fix in facets (avoid to have an horizontal space between facets when facets are unfold)
web/facet.py
--- a/web/facet.py	Tue Feb 24 20:59:46 2009 +0100
+++ b/web/facet.py	Wed Feb 25 09:30:30 2009 +0100
@@ -507,10 +507,7 @@
     def _render(self):
         title = html_escape(self.facet.title)
         facetid = html_escape(self.facet.id)
-        if len(self.items) > 6:
-            self.w(u'<div id="%s" class="facet overflowed">\n' % facetid)
-        else:
-            self.w(u'<div id="%s" class="facet">\n' % facetid)
+        self.w(u'<div id="%s" class="facet">\n' % facetid)
         self.w(u'<div class="facetTitle" cubicweb:facetName="%s">%s</div>\n' %
                (html_escape(facetid), title))
         if self.facet.support_and():
@@ -523,6 +520,8 @@
         cssclass = ''
         if not self.facet.start_unfolded:
             cssclass += ' hidden'
+        if len(self.items) > 6:
+            cssclass +=' overflowed'
         self.w(u'<div class="facetBody%s">\n' % cssclass)
         for item in self.items:
             item.render(self.w)