Skip to content

Instantly share code, notes, and snippets.

@infn8
Created April 2, 2018 03:42
Show Gist options
  • Save infn8/15148679e198e56a775eed65beda12bf to your computer and use it in GitHub Desktop.
Save infn8/15148679e198e56a775eed65beda12bf to your computer and use it in GitHub Desktop.
// paste into WP console in admin
jQuery(document).ready(function($) {
$('.acf-flexible-content .values .acf-icon.-collapse').click(function(e){
$this = $(this);
if(e.shiftKey) {
open = $this.is('.-collapsed .-collapse');
console.log('shift clicked');
console.log('open: ', open);
if (open){
$all = $this.parentsUntil('.values').parent().find('.-collapsed .acf-icon.-collapse');
} else {
$all = $this.parentsUntil('.values').parent().find('.acf-icon.-collapse').not('.-collapsed .-collapse');
}
$all.not($this).click();
}
});
});
@infn8
Copy link
Author

infn8 commented Apr 2, 2018

only tested on VERY simple use cases. Will expand to more later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment