setupLayer.js 809 Bytes
var setupitem = [];
$(function(){
	var items = window.parent.setupLayerData;
	$('.checkbox input[type="checkbox"]').each(function(){
		var text = $(this).parents().children("label").text();
		for(var i=0;i<items.length;i++){
			if(text==items[i]){
				$(this).attr("checked","checked");
			}
		}
	});
	btnEvent();
});

function btnEvent(){
	$('ul li').click(function(){
		var checkbox = $(this).find('input[type="checkbox"]');
		checkbox.prop('checked', !checkbox.prop('checked'));
	});
	$('.checkbox input[type="checkbox"]').click(function(e){  
	    e.stopPropagation();   
	});  
}


function checkboxitem(){
	setupitem = [];
	$('.checkbox input[type="checkbox"]:checked').each(function(){
		var inputText = $(this).parents().children("label").text();
		setupitem.push(inputText);
	});
	return setupitem;
}