From 39cb82e83d4fcc74fa7b95b760c7b6e68306b09b Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 15 Aug 2014 12:08:43 +0800 Subject: [PATCH] fix site structure main-enable checkboxes --- app/assets/javascripts/lib/items/items.js.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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"); } })