Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed current folio styling on grid view #12

Merged
merged 6 commits into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions editioncrafter/src/component/ImageGridView.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class ImageGridView extends React.Component {
componentDidMount() {
const { documentView } = this.props;
const folioID = documentView[this.props.side].iiifShortID;
const thumbs = this.generateThumbs(folioID, this.state.currentDoc ? this.props.document.folios.filter((folio) => (folio.doc_id === this.state.currentDoc)) : this.props.document.folios);
const thumbs = this.generateThumbs(folioID, this.props.document.variorum && this.state.currentDoc ? this.props.document.folios.filter((folio) => (folio.doc_id === this.state.currentDoc)) : this.props.document.folios);
console.log(thumbs);
console.log(this.props.document.folios);
const thumbCount = (thumbs.length > this.loadIncrement) ? this.loadIncrement : thumbs.length;
const visibleThumbs = thumbs.slice(0, thumbCount);
this.setState({ thumbs, visibleThumbs });
Expand All @@ -136,9 +138,9 @@ class ImageGridView extends React.Component {
const thumbs = folios.map((folio, index) => (
// eslint-disable-next-line react/no-array-index-key
<li key={`thumb-${index}`} className="thumbnail">
<figure className={(folio.id === currentID) ? 'current' : ''}><a id={folio.id} onClick={this.onClickThumb.bind(this, folio.id)}><img src={folio.image_thumbnail_url} alt={folio.name} style={{maxWidth: "130px", maxHeight: "130px"}} onError={({ currentTarget }) => {currentTarget.onerror = null; if (folio.image_zoom_url && currentTarget.src !== `${folio.image_zoom_url.slice(0, -9)}full/full/0/default.jpg`) {currentTarget.src=`${folio.image_zoom_url.slice(0, -9)}full/full/0/default.jpg`;} }} /></a></figure>
<figcaption className={(folio.id === currentID) ? 'thumbnail-caption current' : 'thumbnail-caption'}>
{(folio.id === currentID) ? (`*${folio.name}`) : folio.name}
<figure><a id={folio.id} onClick={this.onClickThumb.bind(this, folio.id)}><img src={folio.image_thumbnail_url} alt={folio.name} style={{maxWidth: "130px", maxHeight: "130px"}} onError={({ currentTarget }) => {currentTarget.onerror = null; if (folio.image_zoom_url && currentTarget.src !== `${folio.image_zoom_url.slice(0, -9)}full/full/0/default.jpg`) {currentTarget.src=`${folio.image_zoom_url.slice(0, -9)}full/full/0/default.jpg`;} }} /></a></figure>
<figcaption className='thumbnail-caption'>
{folio.name}
</figcaption>

</li>
Expand Down
Loading