Created
April 2, 2018 03:42
-
-
Save infn8/15148679e198e56a775eed65beda12bf to your computer and use it in GitHub Desktop.
This file contains 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 characters
// 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(); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
only tested on VERY simple use cases. Will expand to more later