diff --git a/resources/views/settings/settings/edit.blade.php b/resources/views/settings/settings/edit.blade.php
index 37a5700bf..692d93a7c 100644
--- a/resources/views/settings/settings/edit.blade.php
+++ b/resources/views/settings/settings/edit.blade.php
@@ -252,39 +252,50 @@
});
@endif
- $('#invoice_logo').fancyfile({
- text : '{{ trans('general.form.select.file') }}',
- style : 'btn-default',
- @if($setting['invoice_logo'])
- placeholder : '{{ $setting['invoice_logo']->basename }}',
- @else
- placeholder : '{{ trans('general.form.no_file_selected') }}',
- @endif
+ 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') }}',
+ style : 'btn-default',
+ @if($setting['invoice_logo'])
+ placeholder : '{{ $setting['invoice_logo']->basename }}',
+ @else
+ placeholder : '{{ trans('general.form.no_file_selected') }}',
+ @endif
+ });
+
+ @if($setting['invoice_logo'])
+ invoice_logo_html = '';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' {{ $setting['invoice_logo']->basename }}';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' {!! Form::open(['id' => 'invoice_logo-' . $setting['invoice_logo']->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $setting['invoice_logo']->id)], 'style' => 'display:inline']) !!}';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' ';
+ invoice_logo_html += ' {!! Form::close() !!}';
+ invoice_logo_html += '';
+
+ $(target + ' .fancy-file .fake-file').append(invoice_logo_html);
+
+ $(document).on('click', '#remove-invoice_logo', function (e) {
+ confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '' . $setting['invoice_logo']->basename . '', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
+ });
+ @endif
+
+ invoice_file = true;
+ }
});
- @if($setting['invoice_logo'])
- invoice_logo_html = '';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' {{ $setting['invoice_logo']->basename }}';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' {!! Form::open(['id' => 'invoice_logo-' . $setting['invoice_logo']->id, 'method' => 'DELETE', 'url' => [url('uploads/' . $setting['invoice_logo']->id)], 'style' => 'display:inline']) !!}';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' ';
- invoice_logo_html += ' {!! Form::close() !!}';
- invoice_logo_html += '';
-
- $('#invoice .fancy-file .fake-file').append(invoice_logo_html);
-
- $(document).on('click', '#remove-invoice_logo', function (e) {
- confirmDelete("#invoice_logo-{!! $setting['invoice_logo']->id !!}", "{!! trans('general.attachment') !!}", "{!! trans('general.delete_confirm', ['name' => '' . $setting['invoice_logo']->basename . '', 'type' => strtolower(trans('general.attachment'))]) !!}", "{!! trans('general.cancel') !!}", "{!! trans('general.delete') !!}");
- });
- @endif
$("select[name='email_protocol']").on('change', function() {
var selection = $(this).val();
@@ -295,16 +306,14 @@
$("input[name='email_smtp_password']").prop('disabled', true);
$("input[name='email_smtp_port']").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_smtp_host']").prop('disabled', true);
$("input[name='email_smtp_username']").prop('disabled', true);
$("input[name='email_smtp_password']").prop('disabled', true);
$("input[name='email_smtp_port']").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_smtp_host']").prop('disabled', false);
$("input[name='email_smtp_username']").prop('disabled', false);