Don't allow a collapsible list to be expanded if it is too short.

master
Pacman Ghost 4 years ago
parent d0dc4c326c
commit 906de3cfa1
  1. 1
      web/src/SearchResults.css
  2. 8
      web/src/utils.js

@ -31,7 +31,6 @@
.search-result .content .image { float: left ; margin: 0.25em 0.5em 0.5em 0 ; max-height: 8em ; max-width: 6em ; }
.search-result .content .collapsible { margin-top:0.5em ; font-size: 90% ; color: #333 ; }
.search-result .content .collapsible a { color: #333 ; text-decoration: none ; }
.search-result .content .collapsible .caption { cursor: pointer ; }
.search-result .content .collapsible .caption img { height: 0.75em ; margin-left: 0.25em ; }
.search-result .content .collapsible .count { font-size: 80% ; font-style: italic ; color: #666 ; }
.search-result .content .collapsible ul { margin: 0 0 0 1em ; }

@ -193,8 +193,14 @@ export function makeCollapsibleList( caption, vals, maxItems, style ) {
caption = <span> {caption+":"} </span> ;
else
caption = <span> {caption} <span className="count"> ({vals.length}) </span> </span> ;
let onClick, style2 ;
if ( excessItems.length > 0 ) {
onClick = flipExcessItems ;
style2 = { cursor: "pointer" } ;
}
return ( <div className="collapsible" style={style}>
<div className="caption" onClick={flipExcessItems}> {caption}
<div className="caption" onClick={onClick} style={style2} >
{caption}
{ excessItems.length > 0 && <img src="images/collapsible-down.png" ref={r => flipButtonRef=r} alt="Show/hide extra items." /> }
</div>
<ul> {items} </ul>

Loading…
Cancel
Save