diff options
Diffstat (limited to 'src/page')
-rw-r--r-- | src/page/album.js | 58 | ||||
-rw-r--r-- | src/page/flash.js | 4 |
2 files changed, 34 insertions, 28 deletions
diff --git a/src/page/album.js b/src/page/album.js index 741fcaba..cb512e86 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -580,8 +580,6 @@ export function generateAlbumChronologyLinks(album, currentTrack, { generateChronologyLinks, html, }) { - const isTrackPage = !!currentTrack; - return html.tag( 'div', { @@ -589,34 +587,38 @@ export function generateAlbumChronologyLinks(album, currentTrack, { class: 'nav-chronology-links', }, [ - isTrackPage && - generateChronologyLinks(currentTrack, { - contribKey: 'artistContribs', - getThings: (artist) => [ - ...artist.tracksAsArtist, - ...artist.tracksAsContributor, - ], - headingString: 'misc.chronology.heading.track', - }), + ...html.fragment( + currentTrack && [ + ...html.fragment( + generateChronologyLinks(currentTrack, { + contribKey: 'artistContribs', + getThings: (artist) => [ + ...artist.tracksAsArtist, + ...artist.tracksAsContributor, + ], + headingString: 'misc.chronology.heading.track', + })), - isTrackPage && - generateChronologyLinks(currentTrack, { - contribKey: 'contributorContribs', + ...html.fragment( + generateChronologyLinks(currentTrack, { + contribKey: 'contributorContribs', + getThings: (artist) => [ + ...artist.tracksAsArtist, + ...artist.tracksAsContributor, + ], + headingString: 'misc.chronology.heading.track', + })), + ]), + + ...html.fragment( + generateChronologyLinks(currentTrack || album, { + contribKey: 'coverArtistContribs', + dateKey: 'coverArtDate', getThings: (artist) => [ - ...artist.tracksAsArtist, - ...artist.tracksAsContributor, + ...artist.albumsAsCoverArtist, + ...artist.tracksAsCoverArtist, ], - headingString: 'misc.chronology.heading.track', - }), - - generateChronologyLinks(currentTrack || album, { - contribKey: 'coverArtistContribs', - dateKey: 'coverArtDate', - getThings: (artist) => [ - ...artist.albumsAsCoverArtist, - ...artist.tracksAsCoverArtist, - ], - headingString: 'misc.chronology.heading.coverArt', - }), + headingString: 'misc.chronology.heading.coverArt', + })), ]); } diff --git a/src/page/flash.js b/src/page/flash.js index 1e818ae9..e5353a18 100644 --- a/src/page/flash.js +++ b/src/page/flash.js @@ -229,6 +229,10 @@ function generateNavForFlash(flash, { bottomRowContent: previousNextLinks && `(${previousNextLinks})`, content: html.tag('div', + { + [html.onlyIfContent]: true, + class: 'nav-chronology-links', + }, generateChronologyLinks(flash, { headingString: 'misc.chronology.heading.flash', contribKey: 'contributorContribs', |