close #596 Fixed: Settings Invoice logo attachment is passive
This commit is contained in:
parent
e97c305d79
commit
2da5ad838c
@ -252,7 +252,13 @@
|
|||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
$('#invoice_logo').fancyfile({
|
var invoice_file = false;
|
||||||
|
|
||||||
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||||
|
var target = $(e.target).attr("href");
|
||||||
|
|
||||||
|
if (target == '#invoice' && !invoice_file) {
|
||||||
|
$(target + ' #invoice_logo').fancyfile({
|
||||||
text : '{{ trans('general.form.select.file') }}',
|
text : '{{ trans('general.form.select.file') }}',
|
||||||
style : 'btn-default',
|
style : 'btn-default',
|
||||||
@if($setting['invoice_logo'])
|
@if($setting['invoice_logo'])
|
||||||
@ -279,12 +285,17 @@
|
|||||||
invoice_logo_html += ' {!! Form::close() !!}';
|
invoice_logo_html += ' {!! Form::close() !!}';
|
||||||
invoice_logo_html += '</span>';
|
invoice_logo_html += '</span>';
|
||||||
|
|
||||||
$('#invoice .fancy-file .fake-file').append(invoice_logo_html);
|
$(target + ' .fancy-file .fake-file').append(invoice_logo_html);
|
||||||
|
|
||||||
$(document).on('click', '#remove-invoice_logo', function (e) {
|
$(document).on('click', '#remove-invoice_logo', function (e) {
|
||||||
confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['invoice_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '<strong>' . $setting['invoice_logo']->basename . '</strong>', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
|
||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
invoice_file = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$("select[name='email_protocol']").on('change', function() {
|
$("select[name='email_protocol']").on('change', function() {
|
||||||
var selection = $(this).val();
|
var selection = $(this).val();
|
||||||
|
|
||||||
@ -295,16 +306,14 @@
|
|||||||
$("input[name='email_smtp_password']").prop('disabled', true);
|
$("input[name='email_smtp_password']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_port']").prop('disabled', true);
|
$("input[name='email_smtp_port']").prop('disabled', true);
|
||||||
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
||||||
}
|
} else if(selection == 'sendmail') {
|
||||||
else if(selection == 'sendmail') {
|
|
||||||
$("input[name='email_sendmail_path']").prop('disabled', false);
|
$("input[name='email_sendmail_path']").prop('disabled', false);
|
||||||
$("input[name='email_smtp_host']").prop('disabled', true);
|
$("input[name='email_smtp_host']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_username']").prop('disabled', true);
|
$("input[name='email_smtp_username']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_password']").prop('disabled', true);
|
$("input[name='email_smtp_password']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_port']").prop('disabled', true);
|
$("input[name='email_smtp_port']").prop('disabled', true);
|
||||||
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
$("select[name='email_smtp_encryption']").prop('disabled', true);
|
||||||
}
|
} else if (selection == 'smtp') {
|
||||||
else if (selection == 'smtp') {
|
|
||||||
$("input[name='email_sendmail_path']").prop('disabled', true);
|
$("input[name='email_sendmail_path']").prop('disabled', true);
|
||||||
$("input[name='email_smtp_host']").prop('disabled', false);
|
$("input[name='email_smtp_host']").prop('disabled', false);
|
||||||
$("input[name='email_smtp_username']").prop('disabled', false);
|
$("input[name='email_smtp_username']").prop('disabled', false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user