diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index ba852a3..5922b1d 100755 --- a/app/assets/javascripts/lib/items/items.js.erb +++ b/app/assets/javascripts/lib/items/items.js.erb @@ -110,22 +110,22 @@ var Items = function(){ sidePanel.on("click","#enable-menu .main-enable-parent",function(e){ if(!$(this).is(":checked")){ var parent = $(this).parent().parent(); - parent.find(".main-enable-child,.main-enable-child-child").removeAttr("checked"); - + $(".main-enable-child[value="+ $(this).val() +"]").removeAttr("checked"); + $(".main-enable-child-child[value="+ $(this).val() +"]").removeAttr("checked"); } }) sidePanel.on("click","#enable-menu .main-enable-child",function(e){ - if(!$("input[for=checkbox_for_"+ $(this).val() +"]").is(":checked")){ + if(!$(".main-enable-parent[value="+ $(this).val() +"]").is(":checked")){ $(this).removeAttr("checked"); } if(!$(this).is(":checked")){ - $(this).parent().parent().parent().find(".main-enable-child-child").removeAttr("checked"); + $(".main-enable-child-child[value="+ $(this).val() +"]").removeAttr("checked"); } }) sidePanel.on("click","#enable-menu .main-enable-child-child",function(e){ - if(!$("input[for=checkbox_for_child_"+ $(this).val() +"]").is(":checked")){ + if(!$(".main-enable-child[value="+ $(this).val() +"]").is(":checked")){ $(this).removeAttr("checked"); } })