• Feature suggestion: allow shift-click the headings to open/close all flexible fields accordingly.

    I’ve played around with some JS, but there’s probably far better/prettier methods.

    Anyone reading, feel free to use this (add as JS to admin):

    // Function to handle shift+click event on .acf-fc-layout-handle
        $('.acf-fc-layout-handle').on('click', function(e) {
            if (e.shiftKey) {
                e.preventDefault();
                closestLayout = $(this).closest('.layout');
    
                if (closestLayout.hasClass('-collapsed')) {
                    // console.log('Layout is hidden');
                    setTimeout(function(){
                        $('.acf-flexible-content .values .layout').removeClass('-collapsed');
                        $('.acf-flexible-content .acfe-fc-placeholder').addClass('acf-hidden');
                      }, 1);
                } else {
                    // console.log('Layout is visible');
                    setTimeout(function(){
                        $('.acf-flexible-content .values .layout').addClass('-collapsed');
                        $('.acf-flexible-content .acfe-fc-placeholder').removeClass('acf-hidden');
                      }, 1);
                }
            } 
        });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Open/collapse all items on shift-click heading’ is closed to new replies.