mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix checkbox logic on export page
This commit is contained in:
parent
29a014df20
commit
3588f82fce
@ -49,7 +49,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{!! Former::select('format')
|
{!! Former::select('format')
|
||||||
->onchange('setEntityTypesVisible()')
|
->onchange('setCheckboxesEnabled()')
|
||||||
->addOption('CSV', 'CSV')
|
->addOption('CSV', 'CSV')
|
||||||
->addOption('XLS', 'XLS')
|
->addOption('XLS', 'XLS')
|
||||||
->addOption('JSON', 'JSON')
|
->addOption('JSON', 'JSON')
|
||||||
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
|
|
||||||
{!! Former::inline_radios('include_radio')
|
{!! Former::inline_radios('include_radio')
|
||||||
->onchange('onIncludeChange()')
|
->onchange('setCheckboxesEnabled()')
|
||||||
->label(trans('texts.include'))
|
->label(trans('texts.include'))
|
||||||
->radios([
|
->radios([
|
||||||
trans('texts.all') . ' ' => ['value' => 'all', 'name' => 'include'],
|
trans('texts.all') . ' ' => ['value' => 'all', 'name' => 'include'],
|
||||||
@ -92,16 +92,17 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
setFileTypesVisible();
|
setCheckboxesEnabled();
|
||||||
onIncludeChange();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function setEntityTypesVisible() {
|
function setCheckboxesEnabled() {
|
||||||
var selector = '.entity-types input[type=checkbox]';
|
var $checkboxes = $('input[type=checkbox]');
|
||||||
if ($('#format').val() === 'JSON') {
|
var include = $('input[name=include]:checked').val()
|
||||||
$(selector).attr('disabled', true);
|
var format = $('#format').val();
|
||||||
|
if (include === 'all' || format === 'JSON') {
|
||||||
|
$checkboxes.attr('disabled', true);
|
||||||
} else {
|
} else {
|
||||||
$(selector).removeAttr('disabled');
|
$checkboxes.removeAttr('disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,16 +129,6 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
}
|
}
|
||||||
|
|
||||||
function onIncludeChange() {
|
|
||||||
var $checkboxes = $('input[type=checkbox]');
|
|
||||||
var val = $('input[name=include]:checked').val()
|
|
||||||
if (val == 'all') {
|
|
||||||
$checkboxes.attr('disabled', true);
|
|
||||||
} else {
|
|
||||||
$checkboxes.removeAttr('disabled');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user