This commit is contained in:
Ludovic CANDELLIER
2021-03-30 23:06:12 +02:00
parent 993154674e
commit a7881e4261
8 changed files with 34 additions and 4 deletions

View File

@@ -16,4 +16,3 @@
</div>
</div>
</div>

View File

@@ -1 +1 @@
@include('components.button', ['class' => 'btn-success save ' . ($class ?? ''), 'icon' => 'fa-save', 'txt' => __('save')])
@include('components.button', ['type' => 'submit', 'class' => 'btn-success save ' . ($class ?? ''), 'icon' => 'fa-save', 'txt' => __('save')])

View File

@@ -0,0 +1,18 @@
@if(!defined('LOAD_SAVE'))
@push('scripts')
<script>
function initSaveForm(sel, form) {
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
var form = (typeof(form) == 'undefined') ? '#form' : form;
console.log(selector);
console.log(form);
$(selector).off().click(function(e) {
console.log("ici");
e.preventDefault();
$(form).submit();
});
}
</script>
@endpush
@php(define('LOAD_SAVE', true))
@endif