summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.media
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-08 19:09:53 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-08 19:09:53 +0200
commit8e130b207f7bb71680fbd87a7c7bc3cf38832cd2 (patch)
treea6b232d28209dfdf347060f1a9ce55048eb41c2f /animism-align/frontend/app/views/viewer/player/components.media
parente5610ad8d3c14dbf4cb8a8e0600c297e51986766 (diff)
vitrine size edits, fix form to not break on that one gallery with the missing display images...
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.media')
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.media/media.vitrine.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.media/media.vitrine.js b/animism-align/frontend/app/views/viewer/player/components.media/media.vitrine.js
index 4fc3964..ae0bfd7 100644
--- a/animism-align/frontend/app/views/viewer/player/components.media/media.vitrine.js
+++ b/animism-align/frontend/app/views/viewer/player/components.media/media.vitrine.js
@@ -6,7 +6,11 @@ import actions from 'app/actions'
export const Vitrine = ({ media }) => {
const { image_order, image_lookup, thumbnail_lookup } = media.settings
- const width = (Math.floor(100 / image_order.length * 2) - 2) + '%'
+ let width = (Math.floor(100 / image_order.length * 2))
+ if (image_order.length % 2) {
+ width -= 2
+ }
+ const displayWidth = width + '%'
// console.log(width)
return (
<div className='vitrine-items'>
@@ -18,7 +22,7 @@ export const Vitrine = ({ media }) => {
media={media}
id={id}
image={thumbnail}
- width={width}
+ width={displayWidth}
/>
)
})}