-
Notifications
You must be signed in to change notification settings - Fork 0
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
Beta 2 bugfixes 3 #447
Changes from all commits
219c7a3
765ee2a
90fb53b
760da4a
26a8c63
75a5a81
d0f176b
9847abf
63b5bcc
c09a67a
ea44eae
56b9de5
d026869
3ea90fd
708f1fa
abb957f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' ); | ||
} | ||
} ); | ||
} | ||
|
||
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block of code checks for images within a specific wrapper + 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' );
+ }
+ } );
+ } |
||
}; | ||
|
||
/** | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeRabbit
The new code checks if there are any elements with the class
.wp-block-gallery.has-nested-images
and appliesslickLightbox
to them. This is a good change as it ensures that the lightbox functionality is only applied when necessary, improving performance.