Fixes arguments parsing from php to js.

This commit is contained in:
mateuswetah 2021-03-22 10:59:11 -03:00
parent 679941a68b
commit b1e2336bcd
5 changed files with 31 additions and 22 deletions

View File

@ -656,8 +656,11 @@ a.pswp__share--download:hover {
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));
padding: 0 var(--swiper-navigation-size, 44px); }
padding: 0 var(--swiper-navigation-size, 44px);
opacity: 1.0;
transition: opacity 0.2s linear; }
.tainacan-media-component__swiper-main li.swiper-slide:not(.swiper-slide-active) {
opacity: 0.75; }
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata {
text-align: center; }
.tainacan-media-component__swiper-main li.swiper-slide .swiper-slide-metadata.hide-name .swiper-slide-metadata__name {
@ -701,7 +704,7 @@ 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;
background: white;
background: var(--tainacan-media-background, #ffffff);
border-radius: 3px;
word-wrap: break-word; }
.tainacan-media-component__swiper-main .swiper-slide-content audio {
@ -753,12 +756,12 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-thumbs li.swiper-slide img:focus, .tainacan-media-component__swiper-thumbs li.swiper-slide img:hover {
opacity: 0.95;
outline: none;
border-bottom-color: var(--tainacan-secondary, #298596); }
border-bottom-color: var(--swiper-theme-color, #298596); }
.tainacan-media-component__swiper-thumbs li.swiper-slide.swiper-slide-thumb-active .swiper-slide-metadata__name {
font-weight: bold; }
.tainacan-media-component__swiper-thumbs li.swiper-slide.swiper-slide-thumb-active img {
opacity: 1.0;
border-bottom-color: var(--tainacan-secondary, #298596); }
border-bottom-color: var(--swiper-theme-color, #298596); }
.tainacan-media-component__swiper-thumbs li.swiper-slide .swiper-slide-metadata__name {
font-size: 1em;
color: var(--tainacan-label-color, #454647); }
@ -863,7 +866,7 @@ a.pswp__share--download:hover {
border-radius: 20px; }
.tainacan-photoswipe-layer .pswp__container video {
min-height: 56px; }
.tainacan-photoswipe-layer .pswp__name {
.tainacan-photoswipe-layer .pswp__top-bar .pswp__name {
color: white;
text-align: center;
font-size: 1.125em;

File diff suppressed because one or more lines are too long

View File

@ -411,10 +411,10 @@ function tainacan_get_the_media_component(
</div>
<?php
wp_add_inline_script( 'tainacan-media-component', "
tainacan_plugin.tainacan_media_components = (typeof tainacan_plugin != undefined && typeof tainacan_plugin.tainacan_media_components != 'undefined') ? tainacan_plugin.tainacan_media_components : [];
tainacan_plugin.tainacan_media_components.push(JSON.parse('" . json_encode($args) . "'));
", 'before' );
wp_add_inline_script( 'tainacan-media-component', '
tainacan_plugin.tainacan_media_components = (typeof tainacan_plugin != undefined && typeof tainacan_plugin.tainacan_media_components != "undefined") ? tainacan_plugin.tainacan_media_components : [];
tainacan_plugin.tainacan_media_components.push('. json_encode($args) . ');
', 'before' );
?>
<?php endif; ?> <!-- End of if ($args['has_media_main'] || $args['has_media_thumbs'] ) -->

View File

@ -66,13 +66,13 @@ class TainacanMediaGallery {
let mainSwiperOptions = {
slidesPerView: 1,
slidesPerGroup: 1,
navigation: {
nextEl: '.swiper-navigation-next_' + this.main_gallery_selector,
prevEl: '.swiper-navigation-prev_' + this.main_gallery_selector,
},
pagination: {
el: '.swiper-pagination_' + this.main_gallery_selector
},
// navigation: {
// nextEl: '.swiper-navigation-next_' + this.main_gallery_selector,
// prevEl: '.swiper-navigation-prev_' + this.main_gallery_selector,
// },
// pagination: {
// el: '.swiper-pagination_' + this.main_gallery_selector
// },
watchOverflow: true,
a11y: {
prevSlideMessage: __( 'Previous slide', 'tainacan'),

View File

@ -67,8 +67,14 @@ $pswp__include-minimal-style: true !default;
}
li.swiper-slide {
height: 100%;
max-width: calc(100% - var(--swiper-navigation-size, 44px) - var(--swiper-navigation-size, 44px));
//max-width: calc(100% - var(--swiper-navigation-size, 44px) - var(--swiper-navigation-size, 44px));
padding: 0 var(--swiper-navigation-size, 44px);
opacity: 1.0;
transition: opacity 0.2s linear;
&:not(.swiper-slide-active) {
opacity: 0.75;
}
.swiper-slide-metadata {
text-align: center;
@ -192,7 +198,7 @@ $pswp__include-minimal-style: true !default;
&:hover {
opacity: 0.95;
outline: none;
border-bottom-color: var(--tainacan-secondary, #298596);
border-bottom-color: var(--swiper-theme-color, #298596);
}
}
&.swiper-slide-thumb-active {
@ -201,7 +207,7 @@ $pswp__include-minimal-style: true !default;
}
img {
opacity: 1.0;
border-bottom-color: var(--tainacan-secondary, #298596);
border-bottom-color: var(--swiper-theme-color, #298596);
}
}
.swiper-slide-metadata__name {
@ -343,7 +349,7 @@ $pswp__include-minimal-style: true !default;
min-height: 56px;
}
}
.pswp__name {
.pswp__top-bar .pswp__name {
color: white;
text-align: center;
font-size: 1.125em;