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) {/*{{{*/ ...@@ -50,15 +50,15 @@ function pieform_element_date(Pieform $form, $element) {/*{{{*/
<script type="application/javascript"> <script type="application/javascript">
function {$name}_toggle(x) { function {$name}_toggle(x) {
var elements = [ var elements = [
$('{$name}_hour'), $('#{$name}_hour'),
$('{$name}_minute'), $('#{$name}_minute'),
$('{$name}_day'), $('#{$name}_day'),
$('{$name}_month'), $('#{$name}_month'),
$('{$name}_year') $('#{$name}_year')
]; ];
for (var i in elements) { $.each(elements, function() {
if (elements[i]) elements[i].disabled = !x.checked; $(this).prop('disabled', !$(x).prop('checked'))
} });
} }
</script> </script>
EOF; EOF;
......
...@@ -95,11 +95,11 @@ function pieform_element_expiry(Pieform $form, $element) {/*{{{*/ ...@@ -95,11 +95,11 @@ function pieform_element_expiry(Pieform $form, $element) {/*{{{*/
$script = <<<EOJS $script = <<<EOJS
<script type="application/javascript" language="javascript"> <script type="application/javascript" language="javascript">
function {$name}_change() { function {$name}_change() {
if ($('{$formname}_{$name}_units').value == 'noenddate') { if ($('#{$formname}_{$name}_units').val() == 'noenddate') {
$('{$formname}_{$name}').disabled = true; $('#{$formname}_{$name}').prop('disabled', true);
} }
else { else {
$('{$formname}_{$name}').disabled = false; $('#{$formname}_{$name}').prop('disabled', false);
} }
} }
</script> </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