Last active
March 13, 2023 13:33
-
-
Save prasetyop/f686a827bc0f4ca9089de7d115d3fa9c to your computer and use it in GitHub Desktop.
Revisions
-
prasetyop revised this gist
Dec 22, 2017 . No changes.There are no files selected for viewing
-
prasetyop created this gist
Dec 22, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ .acf-fc-popup .preview { position: absolute; right: 100%; margin-right: 0px; top: 0; background: #383c44; min-height: 100%; border-radius: 5px; align-content: center; display: grid; } .acf-fc-popup .preview .inner-preview { padding: 10px; } .acf-fc-popup .preview img { display: block; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ jQuery(function($) { $(document).on('hover', '.acf-fc-popup li a', function() { var $this = $(this) var parent = $this.parents('.acf-fc-popup'); var filename = $this.attr('data-layout'); if (parent.find('.preview').length > 0) { parent.find('.preview').html('<div class="inner-preview"><img src="' + theme_var.upload + filename + '.jpg"/></div>') } else { parent.append('<div class="preview"><div class="inner-preview"><img src="' + theme_var.upload + filename + '.jpg"/></div></div>') } }) }) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ // REGISTER CSS & JS add_action( 'admin_enqueue_scripts', 'acf_flexible_content_thumbnail' ); function acf_flexible_content_thumbnail() { // REGISTER ADMIN.CSS wp_enqueue_style( 'css-theme-admin', get_template_directory_uri() . '/css/admin.css', false, 1.0 ); // REGISTER ADMIN.JS wp_register_script( 'js-theme-admin', get_template_directory_uri() . '/js/admin.js', array('jquery'), 1.0, true ); wp_localize_script( 'js-theme-admin', 'theme_var', array( 'upload' => get_template_directory_uri().'/img/acf-thumbnail/', ) ); wp_enqueue_script( 'js-theme-admin'); }