FIX Initial visibility of permission fields when editing a document

This commit is contained in:
Robbie Averill 2017-05-18 12:47:22 +12:00
parent 2039d72688
commit 708721a5aa
1 changed files with 10 additions and 9 deletions

View File

@ -34,20 +34,21 @@
}
}
});*/
$('#CanViewType input, #CanEditType input').entwine({
$('.permissions input[name="CanViewType"], .permissions input[name="CanEditType"]').entwine({
onchange: function () {
var dropDown = $(this).closest('.field').next();
if ($(this).val() === 'OnlyTheseUsers') {
if (!this.is(':checked')) {
return;
}
var dropDown = this.closest('.fieldholder-small').next();
if (this.val() === 'OnlyTheseUsers') {
dropDown.removeClass('hide');
} else {
dropDown.addClass('hide');
}
},
onadd: function () {
if ($(this).is(':checked') && $(this).val() === 'OnlyTheseUsers') {
var dropDown = $(this).closest('.field').next();
dropDown.removeClass('hide');
}
this.trigger('change');
}
});
$('#Actions ul li').entwine({