web/facet.py
changeset 368 84a5106840fa
parent 346 5bbb01a133ae
child 407 68783684ec2f
--- a/web/facet.py	Thu Jan 08 10:50:30 2009 +0100
+++ b/web/facet.py	Thu Jan 08 12:12:40 2009 +0100
@@ -503,7 +503,10 @@
     def _render(self):
         title = html_escape(self.facet.title)
         facetid = html_escape(self.facet.id)
-        self.w(u'<div id="%s" class="facet">\n' % facetid)
+        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 class="facetTitle" cubicweb:facetName="%s">%s</div>\n' %
                (html_escape(facetid), title))
         if self.facet.support_and():
@@ -513,10 +516,9 @@
   <option value="AND">%s</option>
 </select>''' % (facetid + '_andor', _('and/or between different values'),
                 _('OR'), _('AND')))
-        if self.facet.start_unfolded:
-            cssclass = ''
-        else:
-            cssclass = ' hidden'
+        cssclass = ''
+        if not self.facet.start_unfolded:
+            cssclass += ' hidden'
         self.w(u'<div class="facetBody%s">\n' % cssclass)
         for item in self.items:
             item.render(self.w)