# HG changeset patch # User Sylvain Thenault # Date 1231413160 -3600 # Node ID 84a5106840fa25f73671f171bf2852a35063b1bf # Parent 2c0d00b403879a0572fb7ad621aefdc099a64855 facet widgets css cleanup diff -r 2c0d00b40387 -r 84a5106840fa web/data/cubicweb.facets.css --- a/web/data/cubicweb.facets.css Thu Jan 08 10:50:30 2009 +0100 +++ b/web/data/cubicweb.facets.css Thu Jan 08 12:12:40 2009 +0100 @@ -1,60 +1,63 @@ #filterbox fieldset{ - margin:0px; - padding:0px; + margin: 0px; + padding: 0px; } div.facet { - margin-bottom:8px; + margin-bottom: 8px; background: #fff; padding: 5px; + min-width: 10em; } div.facetTitle, div.bkSearch { font-size: 80%; - width:220px; color: #000; - margin-bottom:2px; + margin-bottom: 2px; cursor: pointer; font: bold 100% Georgia; } -div.facetTitle a{ + +div.facetTitle a { padding-left: 10px; background: transparent url("puce.png") 0% 50% no-repeat; } +div.facetBody { +} + .opened{ color: #000 !important; } -div.owerflowed{ - height: 10em; - overflow: auto; +div.overflowed{ + height: 12em; + overflow-y: auto; } div.facetCheckBox { - clear:both; + clear: both; cursor: pointer; } div.facetCheckBox a { text-decoration: none; - font-size:85%; + font-size: 85%; } div.facetValue{ -clear:both +clear: both } div.facetValue img{ - width:16px; - float:left; - background:#fff; + float: left; + background: #fff; } div.facetValue a { - margin-left:20px; - display:block; - margin-top:-6px; /* FIXME why do we need this ? */ + margin-left: 20px; + display: block; + margin-top: -6px; /* FIXME why do we need this ? */ } div.facetValueSelected a { @@ -95,10 +98,10 @@ margin-top: 50px; margin-bottom: 1em; color: #1190A1; - font-size:75%; - font-weight:bold; - padding:0.15em; - text-transform:uppercase; + font-size: 75%; + font-weight: bold; + padding: 0.15em; + text-transform: uppercase; } diff -r 2c0d00b40387 -r 84a5106840fa web/data/cubicweb.formfilter.js --- a/web/data/cubicweb.formfilter.js Thu Jan 08 10:50:30 2009 +0100 +++ b/web/data/cubicweb.formfilter.js Thu Jan 08 12:12:40 2009 +0100 @@ -107,12 +107,6 @@ function initFacetBoxEvents(root){ root = root || document; - jQuery(root).find('div.facetBody').each(function (){ - var height = jQuery(this).height(); - if (height > 160){ - jQuery(this).addClass('owerflowed'); - } - }); jQuery(root).find('form').each(function () { var form = jQuery(this); var facetargs = form.attr('cubicweb:facetargs'); diff -r 2c0d00b40387 -r 84a5106840fa web/facet.py --- 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'
\n' % facetid) + if len(self.items) > 6: + self.w(u'
\n' % facetid) + else: + self.w(u'
\n' % facetid) self.w(u'
%s
\n' % (html_escape(facetid), title)) if self.facet.support_and(): @@ -513,10 +516,9 @@ ''' % (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'
\n' % cssclass) for item in self.items: item.render(self.w)