Skip to content

Instantly share code, notes, and snippets.

View stuartduff's full-sized avatar

Stuart Duff stuartduff

View GitHub Profile
// Options toggler hanlder
// To turn on/off other options base on toggler selection
function initOptionToggler() {
$(document).delegate('.yk-toggler', 'click', function(){
var toggler_name = $(this).attr("name").replace("option_tree[","").replace("]","");
var toggler_value = $(".yk-toggler[name*="+toggler_name+"]:checked").val();
// Turn off all .yk-toggle-able fields
$(".yk-toggle-able[class*="+toggler_name+"]").parents(".format-settings").slideUp();