From 563b9f82cf9af055449d1ba721e64fb6e2150565 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 2 Apr 2015 10:40:11 +0200 Subject: [PATCH] Bug 13212 - Use CSS3 ellipsis instead of FacetLabelTruncationLength - intranet CSS3 has text-overflow: ellipsis - should use that instead of FacetLabelTruncationLength. This patch provides a POC for intranet. It adds ellipsis on all facet types except the availability one. Try to play with facets block size to see ellipsis is correct. See that facet count is hidden when ellipsis is used. An easy way to correct would be to set facet count first. --- C4/Search.pm | 8 -------- koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index f93dd15..f3fa0df 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -535,14 +535,6 @@ sub getRecords { # fix the length that will display in the label, my $facet_label_value = $one_facet; - my $facet_max_length = C4::Context->preference( - 'FacetLabelTruncationLength') - || 20; - $facet_label_value = - substr( $one_facet, 0, $facet_max_length ) - . "..." - if length($facet_label_value) > - $facet_max_length; # if it's a branch, label by the name, not the code, if ( $link_value =~ /branch/ ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 1759f46..fbeb613 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1538,6 +1538,15 @@ li.email { font-size : 85%; margin-bottom : 2px; padding : .1em .2em; + text-overflow : ellipsis; + white-space : nowrap; + overflow : hidden; +} + +#search-facets li#availability_facet li { + text-overflow : clip; + white-space : normal; + overflow : visible; } #search-facets li.showmore { -- 2.1.0