forked from GNUsocial/gnu-social
add checkbox initialization
This commit is contained in:
parent
9018a118fa
commit
ac24ed3dff
21
js/util.js
21
js/util.js
@ -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
2
js/util.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user