Skip to content

Commit

Permalink
Updating the slider js and CSS.
Browse files Browse the repository at this point in the history
  • Loading branch information
krugazul committed Dec 17, 2024
1 parent e018fe7 commit 0406cff
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 130 deletions.
5 changes: 3 additions & 2 deletions assets/css/scss/_slider.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.wp-block-query.lsx-to-slider {
.lsx-to-slider {
&.travel-information {
.slick-list {
max-width: 100% !important;
Expand All @@ -12,7 +12,8 @@
}
}

.wp-block-query {
.wp-block-query,
.lsx-travel-information-wrapper {
&.lsx-to-slider {
gap: var(--wp--preset--spacing--small) var(--wp--preset--spacing--small);
position: relative;
Expand Down
151 changes: 25 additions & 126 deletions assets/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/src/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ if ( window.location.hash ) {
} );

// Second slider: .lsx-to-slider.travel-information
$( '.lsx-to-slider .travel-information:not(.slider-disabled)' ).each( function() {
$( '.lsx-travel-information-wrapper.lsx-to-slider .travel-information:not(.slider-disabled)' ).each( function() {
var $this = $( this );

lsx_to.pre_build_slider( $this );
Expand Down
9 changes: 9 additions & 0 deletions includes/classes/blocks/class-registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,19 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj
}

$pattern = "/(lsx|facts)-(.*?)-wrapper/";
//$pattern = "/(lsx|facts)-((?:\w+-?)+)-wrapper/";
preg_match( $pattern, $parsed_block['attrs']['className'], $matches );

if ( empty( $matches ) ) {
return $block_content;
}

do_action( 'qm/debug', $matches );

if ( in_array( 'travel-information', $matches ) ) {
return $block_content;
}

if ( ! empty( $matches ) && isset( $matches[0] ) ) {
// Save the first match to a variable
$key = str_replace( [ 'facts-', 'lsx-', '-wrapper' ], '', $matches[0] );
Expand Down Expand Up @@ -385,6 +392,8 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj

foreach ( $key_array as $meta_key ) {
$value = lsx_to_custom_field_query( $meta_key, '', '', false );

do_action( 'qm/debug', $value );

// we need to see if the posts exist before we can use them
if ( stripos( $meta_key, '_to_' ) && 0 === $this->post_ids_exist( $value ) ) {
Expand Down

0 comments on commit 0406cff

Please sign in to comment.