Commit 44958c3e authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1668131: group editability dates disabled"

parents 28d3d529 3a3c139d
......@@ -50,15 +50,15 @@ function pieform_element_date(Pieform $form, $element) {/*{{{*/
<script type="application/javascript">
function {$name}_toggle(x) {
var elements = [
$('{$name}_hour'),
$('{$name}_minute'),
$('{$name}_day'),
$('{$name}_month'),
$('{$name}_year')
$('#{$name}_hour'),
$('#{$name}_minute'),
$('#{$name}_day'),
$('#{$name}_month'),
$('#{$name}_year')
];
for (var i in elements) {
if (elements[i]) elements[i].disabled = !x.checked;
}
$.each(elements, function() {
$(this).prop('disabled', !$(x).prop('checked'))
});
}
</script>
EOF;
......
......@@ -95,11 +95,11 @@ function pieform_element_expiry(Pieform $form, $element) {/*{{{*/
$script = <<<EOJS
<script type="application/javascript" language="javascript">
function {$name}_change() {
if ($('{$formname}_{$name}_units').value == 'noenddate') {
$('{$formname}_{$name}').disabled = true;
if ($('#{$formname}_{$name}_units').val() == 'noenddate') {
$('#{$formname}_{$name}').prop('disabled', true);
}
else {
$('{$formname}_{$name}').disabled = false;
$('#{$formname}_{$name}').prop('disabled', false);
}
}
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment