Moves title to bottom of the pswp layer :(

This commit is contained in:
mateuswetah 2021-03-19 18:56:41 -03:00
parent 5391817b87
commit 679941a68b
4 changed files with 21 additions and 19 deletions

View File

@ -652,6 +652,8 @@ a.pswp__share--download:hover {
display: flex;
align-items: center;
margin-bottom: 30px; }
.tainacan-media-component__swiper-main ul.swiper-wrapper[data-pswp-uid] li.swiper-slide img {
cursor: zoom-in !important; }
.tainacan-media-component__swiper-main li.swiper-slide {
height: 100%;
max-width: calc(100% - var(--swiper-navigation-size, 44px) - var(--swiper-navigation-size, 44px));
@ -699,7 +701,6 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-main .swiper-slide-content a:first-of-type,
.tainacan-media-component__swiper-main .swiper-slide-content p:first-of-type {
z-index: 99;
padding: 0.25em 0.5em;
background: white;
border-radius: 3px;
word-wrap: break-word; }

File diff suppressed because one or more lines are too long

View File

@ -159,8 +159,10 @@ class TainacanMediaGallery {
caption,
description
}
} else {
item.title = false;
}
item.el = liElement; // save link to element for getThumbBoundsFn
items.push(item);
}
@ -213,25 +215,21 @@ class TainacanMediaGallery {
// isFake - true when content is added to fake caption container
// (used to get size of next or previous caption)
if(!item.title) {
captionEl.children[0].innerHTML = '';
return false;
}
captionEl.children[0].innerHTML = '';
if (item.title.name) {
let nameElement = document.querySelector('.pswp__name');
if (nameElement && item.title.name)
nameElement.innerHTML = item.title.name.innerHTML;
else
captionEl.children[0].innerHTML += '<span class="pswp__title">' + item.title.name.innerHTML + '</span>';
}
if(!item.title)
return false;
if (item.title.caption)
captionEl.children[0].innerHTML += '<span class="pswp__figure_caption">' + item.title.caption.innerHTML + '</span>';
if (item.title.name && item.title.caption || (!item.title.name && item.title.caption && item.title.description) )
captionEl.children[0].innerHTML += '<br>';
if (item.title.name)
captionEl.children[0].innerHTML += '<span class="pswp__name">' + item.title.name.innerHTML + '</span>';
if (item.title.description && item.title.caption)
if (item.title.description && item.title.name)
captionEl.children[0].innerHTML += '<br>';
if (item.title.description)

View File

@ -60,6 +60,10 @@ $pswp__include-minimal-style: true !default;
display: flex;
align-items: center;
margin-bottom: 30px;
&[data-pswp-uid] li.swiper-slide img {
cursor: zoom-in !important;
}
}
li.swiper-slide {
height: 100%;
@ -124,8 +128,7 @@ $pswp__include-minimal-style: true !default;
a:first-of-type,
p:first-of-type {
z-index: 99;
padding: 0.25em 0.5em;
background: white;
background: var(--tainacan-media-background, #ffffff);
border-radius: 3px;
word-wrap: break-word;
}