From e89454b29105766d3c5933257eb0ba54db318fab Mon Sep 17 00:00:00 2001 From: Fabiano Alencar Date: Fri, 21 Dec 2018 17:22:04 -0200 Subject: [PATCH] Added modal/gallery on thumbnails of single items collections using lightbox. --- src/assets/js/js.js | 5 +++++ src/assets/scss/style.scss | 11 ++++++++++- src/functions/enqueues.php | 12 ++++++++++-- src/tainacan/single-items.php | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/assets/js/js.js b/src/assets/js/js.js index 56ab76a..706cf63 100644 --- a/src/assets/js/js.js +++ b/src/assets/js/js.js @@ -112,4 +112,9 @@ jQuery( document ).ready(function( $ ) { } return false; }); + + $(document).on('click', '[data-toggle="lightbox"]', function(event) { + event.preventDefault(); + $(this).ekkoLightbox(); + }); }); diff --git a/src/assets/scss/style.scss b/src/assets/scss/style.scss index 3c873a3..fc96842 100644 --- a/src/assets/scss/style.scss +++ b/src/assets/scss/style.scss @@ -608,4 +608,13 @@ nav{ @import "_footer"; -@import "_view-mode-grid.scss"; \ No newline at end of file +@import "_view-mode-grid.scss"; + +.ekko-lightbox-nav-overlay { + a { + opacity: 1; + span { + padding: 0; + } + } +} \ No newline at end of file diff --git a/src/functions/enqueues.php b/src/functions/enqueues.php index 2310220..a6f54d0 100644 --- a/src/functions/enqueues.php +++ b/src/functions/enqueues.php @@ -14,9 +14,9 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) { //Style wp_register_style( 'tainacan_bootstrap4CSS', get_template_directory_uri() . '/assets/vendor/bootstrap/css/bootstrap.min.css' ); wp_enqueue_style( 'tainacan_bootstrap4CSS' ); - //Popper + /* //Popper wp_register_script( 'tainacan_popper_bootstrap4', get_template_directory_uri() . '/assets/vendor/bootstrap/js/popper.min.js', '', '', true ); - wp_enqueue_script( 'tainacan_popper_bootstrap4' ); + wp_enqueue_script( 'tainacan_popper_bootstrap4' ); */ //Javascript wp_register_script( 'tainacan_bootstrap4JS', get_template_directory_uri() . '/assets/vendor/bootstrap/js/bootstrap.min.js', array( 'jquery' ), '', true ); wp_enqueue_script( 'tainacan_bootstrap4JS' ); @@ -33,6 +33,14 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) { wp_register_script( 'tainacan_SlickJS', get_template_directory_uri() . '/assets/vendor/slick/js/slick.min.js', array( 'jquery' ), '1.6.1', true ); wp_enqueue_script( 'tainacan_SlickJS' ); + /** + * Ekko Lightbox + */ + wp_register_style( 'tainacan_EkkoLightboxCss', get_template_directory_uri() . '/assets/vendor/ekko-lightbox/ekko-lightbox.min.css'); + wp_enqueue_style( 'tainacan_EkkoLightboxCss' ); + wp_register_script( 'tainacan_EkkoLightboxJs', get_template_directory_uri() . '/assets/vendor/ekko-lightbox/ekko-lightbox.min.js', array('jquery'), null, true); + wp_enqueue_script( 'tainacan_EkkoLightboxJs' ); + /** * Google */ diff --git a/src/tainacan/single-items.php b/src/tainacan/single-items.php index ceb9a3e..3a69e3f 100644 --- a/src/tainacan/single-items.php +++ b/src/tainacan/single-items.php @@ -77,7 +77,7 @@