Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta 2 bugfixes 3 #447

Merged
merged 16 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/img/rating-star-empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/rating-star-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 22 additions & 4 deletions assets/js/blocks/accommodation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ wp.domReady(() => {
metadata: {
name: 'Facilities',
},
className: 'lsx-facilities-wrapper',
className: 'lsx-facility-wrapper',
style: {
spacing: {
padding: {
Expand Down Expand Up @@ -1118,9 +1118,27 @@ wp.domReady(() => {
}
},
[
['core/post-terms', {
term: 'facility',
fontSize: 'x-small'
['core/paragraph', {
metadata: {
bindings: {
content: {
source: 'lsx/post-connection',
args: {
key: 'facilities'
}
}
}
},
className: 'has-septenary-color has-text-color has-link-color has-primary-color has-primary-700-color',
style: {
spacing: {
padding: {
top: '2px',
bottom: '2px'
}
}
},
textColor: 'primary-700'
}]
]
]
Expand Down
33 changes: 22 additions & 11 deletions assets/js/src/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,28 @@ if ( window.location.hash ) {
* @subpackage scripts
*/
lsx_to.build_slider_lightbox = function() {
$( '.single-tour-operator .gallery' ).slickLightbox( {
caption: function( element, info ) {
return $( element ).find( 'img' ).attr( 'alt' );
}
} );

$( '.single-tour-operator .rooms-content' ).slickLightbox( {
caption: function( element, info ) {
return $( element ).find( 'img' ).attr( 'alt' );
}
} );
if ( 0 < $( '.wp-block-gallery.has-nested-images' ).length ) {
$( '.wp-block-gallery.has-nested-images' ).slickLightbox( {
caption: function( element, info ) {
return $( element ).find( 'img' ).attr( 'alt' );
}
} );
}
Comment on lines +335 to +341

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

The new code checks if there are any elements with the class .wp-block-gallery.has-nested-images and applies slickLightbox to them. This is a good change as it ensures that the lightbox functionality is only applied when necessary, improving performance.

+ 		if ( 0 <  $( '.wp-block-gallery.has-nested-images' ).length ) {
+ 			$( '.wp-block-gallery.has-nested-images' ).slickLightbox( {
+ 				caption: function( element, info ) {
+ 					return $( element ).find( 'img' ).attr( 'alt' );
+ 				}
+ 			} );
+ 		}


if ( 0 < $( '.lsx-units-wrapper .unit-image a' ).length ) {
let roomImages = $('.lsx-units-wrapper .unit-image a img').map(function() {
return $(this).attr('src');
}).get();
console.log(roomImages);

$( '.lsx-units-wrapper' ).slickLightbox( {
//images : roomImages,
itemSelector: '.unit-image a',
caption: function( element, info ) {
return $( element ).find( 'img' ).attr( 'alt' );
}
} );
}
Comment on lines +343 to +356

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

This block of code checks for images within a specific wrapper .lsx-units-wrapper .unit-image a and applies slickLightbox to them. However, there's a console.log statement on line 347 which should be removed as it's not a good practice to leave debugging logs in production code.

+ 		if ( 0 <  $( '.lsx-units-wrapper .unit-image a' ).length ) {
+ 			let roomImages = $('.lsx-units-wrapper .unit-image a img').map(function() {
+ 				return $(this).attr('src');
+ 			}).get();
- 			console.log(roomImages);
+ 
+ 			$( '.lsx-units-wrapper' ).slickLightbox( {
+ 				//images : roomImages,
+ 				itemSelector: '.unit-image a',
+ 				caption: function( element, info ) {
+ 					return $( element ).find( 'img' ).attr( 'alt' );
+ 				}
+ 			} );
+ 		}

};

/**
Expand Down
7 changes: 0 additions & 7 deletions bin/build.command

This file was deleted.

176 changes: 0 additions & 176 deletions includes/actions.php

This file was deleted.

Loading
Loading