OPAC Browse: add a CSS class to the best-matching result when not paging
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 10 Jul 2013 19:32:27 +0000 (15:32 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 10 Jul 2013 19:32:27 +0000 (15:32 -0400)
This adds a CSS class to the DOM element around the best-matching browse
result when you've just entered a term, to help the end user spot it in
the middle of the page.  It does not stick around if go forward and back
from your first result page.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/opac/browse.tt2
Open-ILS/src/templates/opac/css/style.css.tt2

index ac12438..a6f990a 100644 (file)
@@ -95,7 +95,7 @@
                     <ol class="browse-result-list">
                     [% FOR result IN ctx.browse_results %]
                         <li class="browse-result">
-                            <span class="browse-result-value">
+                            <span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
                                 <a href="[% mkurl(
                                     ctx.opac_root _ '/results', {
                                         'fi:has_browse_entry' => (result.browse_entry _ ',' _ result.fields)
index 68aac9b..7da8e4c 100644 (file)
@@ -1522,6 +1522,9 @@ a.preflib_change {
 .browse-result-sources, .browse-result-authority-bib-links {
     margin-left: 1em;
 }
+.browse-result-best-match {
+    font-weight: bold;
+}
 .browse-pager {
     margin: 2ex 0;
 }