add checkbox initialization

This commit is contained in:
Evan Prodromou 2011-04-05 11:48:53 -04:00
parent 9018a118fa
commit ac24ed3dff
2 changed files with 23 additions and 2 deletions

View File

@ -1502,6 +1502,25 @@ var SN = { // StatusNet
}
}
});
},
CheckBoxes: function() {
$("span[class='checkbox-wrapper']").addClass("unchecked");
$(".checkbox-wrapper").click(function(){
if($(this).children("input").attr("checked")){
// uncheck
$(this).children("input").attr({checked: ""});
$(this).removeClass("checked");
$(this).addClass("unchecked");
$(this).children("label").text("Private?");
}else{
// check
$(this).children("input").attr({checked: "checked"});
$(this).removeClass("unchecked");
$(this).addClass("checked");
$(this).children("label").text("Private");
}
});
}
}
};
@ -1516,6 +1535,7 @@ var SN = { // StatusNet
$(document).ready(function(){
SN.Init.AjaxForms();
SN.Init.UploadForms();
SN.Init.CheckBoxes();
if ($('.'+SN.C.S.FormNotice).length > 0) {
SN.Init.NoticeForm();
}
@ -1529,3 +1549,4 @@ $(document).ready(function(){
SN.Init.Login();
}
});

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long