(function($) { 'use strict'; $(function() { var acfpro = false; // Detect ACF Pro if($("#acf-pro-input-css").length) { acfpro = true; } // Check if ACF Flexible Content fields exists at all if ($('.acf-fc-layout-handle').length) { // Add expand icons for panels $('.acf-fc-layout-handle').prepend(' 0) { var fieldname_clean = fieldname.replace(/_/g, " ").replace(/acfpro/g, " "); group.append(''); } }); }); // Open/Close panels $(document).on('click', '.acf-fc-layout-handle', function() { var toggle_list = $(this); // Toggle open class if(acfpro) { if($(this).next().next('.row-layout').css("display") == "none") { toggle_list.removeClass('open'); } else { toggle_list.addClass('open'); } } else { if($(this).next('.row_layout').css("display") == "none") { toggle_list.removeClass('open'); } else { toggle_list.addClass('open'); } } }); } }); }(jQuery));