|
@@ -466,7 +466,7 @@
|
|
|
$(dom).addClass('active').attr('disabled', !canClick).parents().siblings('.tab')
|
|
|
.addClass('selected').children('.province').children('.checkbox').attr({
|
|
|
"checked": true
|
|
|
- })
|
|
|
+ }).addClass('half');
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -475,6 +475,7 @@
|
|
|
//如果选中所有,则转为全国
|
|
|
if ($(".city").length == $(".city.active").length) {
|
|
|
$(".checkbox.other").trigger("click");
|
|
|
+ $(".checkbox").removeClass("half");
|
|
|
return
|
|
|
}
|
|
|
var tmpSelect = {};
|
|
@@ -680,12 +681,19 @@
|
|
|
$(".province input").prop('checked', false);
|
|
|
$(".city").removeClass('active');
|
|
|
$(this).prop('checked', true);
|
|
|
+ $(".checkbox").removeClass("half");
|
|
|
} else {
|
|
|
$(".checkbox.other").prop('checked', false);
|
|
|
- if ($(this).is(':checked') == false) {
|
|
|
- $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
|
|
|
- if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
|
|
|
- $(".checkbox.other").prop('checked', true);
|
|
|
+ if (!$(this).is(':checked')) {
|
|
|
+ if ($(this).hasClass("half")) {//判断当前是否是半选
|
|
|
+ $(this).prop("checked", true).removeClass("half");
|
|
|
+ $(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
|
|
|
+ } else {
|
|
|
+ $(this).parent().parent().siblings('.tab_content').children('.city').removeClass('active');
|
|
|
+ if ($(".province .checkbox:checked").length == 0) {//若没有省份被选中 则选中全国
|
|
|
+ $(".checkbox.other").prop('checked', true);
|
|
|
+ $(".checkbox").removeClass("half");
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
$(this).parent().parent().siblings('.tab_content').children('.city').addClass('active');
|
|
@@ -703,6 +711,11 @@
|
|
|
var input = $(this).parents('li').find('input.checkbox')
|
|
|
window.input = input
|
|
|
input.prop('checked', true)
|
|
|
+ if (isActive != $(this).parent().find('.city').length) {//是否全选
|
|
|
+ $(this).parent('div').siblings('.tab').find('.province .checkbox').addClass('half');
|
|
|
+ } else {
|
|
|
+ $(this).parent('div').siblings('.tab').find('.province .checkbox').removeClass('half');
|
|
|
+ }
|
|
|
} else {
|
|
|
$(this).parent('div').siblings('.tab').children().children('.checkbox').prop(
|
|
|
'checked', false)
|