You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
1.1 KiB
1 lines
1.1 KiB
!function(l){l.fn.we7_check=function(){function r(e,c,t){e?l("body").find('[name="'+c+'"]').each(function(){l(this).is(":checked")?l(this).prev(".we7-option").addClass("checked"):l(this).prev(".we7-option").removeClass("checked")}):t.is(":checked")?t.prev(".we7-option").addClass("checked"):t.prev(".we7-option").removeClass("checked")}l(this).each(function(){var e=l(this),c=e.attr("type"),t=e.attr("class")?" "+e.attr("class"):"",i=e.attr("style")?'style="'+e.attr("style")+'"':"",s=e.prev(".we7-option").length,o=e.parent("label").html(),n=e.attr("name"),a=e.is(":checked")||e.attr("we7-check-checked")?" checked ":"",h=e.is(":disabled")?" disabled ":"",d=e.attr("we7-check-all")||"radio"==c;s||(e.before('<div class="we7-option we7-'+c+"-option"+a+h+t+'"'+i+"></div>"),e.on("click",function(){r(d,n,e)}),e.on("change",function(){r(d,n,e)})),o||e.prev('.we7-option:not(".disable")').on("click",function(){l(this).hasClass("checked")==l(this).next(":radio,:checkbox").is(":checked")?(e.trigger("click"),"radio"==c&&e.trigger("click")):l(this).toggleClass("checked")})})}}(jQuery);
|