This commit is contained in:
ludo
2024-03-03 14:44:35 +01:00
parent c15a6e380f
commit 5359375210
6 changed files with 85 additions and 74 deletions

View File

@@ -1,18 +1,20 @@
@once
@push('scripts')
<script>
function initSaveForm(form, sel) {
var form = (typeof(form) == 'undefined') ? '#form' : form;
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
$(selector).off().click(function(e) {
e.preventDefault();
var $button = $(this).find('i .fa-save').first();
$button.removeClass('fa-save');
$button.addClass('fa-spinner fa-spin');
$(form).submit();
});
}
</script>
@endpush
@php(define('LOAD_SAVE', true))
@endonce
@push('scripts')
<script>
function initSaveForm(form, sel) {
initValidator();
var form = (typeof(form) == 'undefined') ? '#form' : form;
var selector = (typeof(sel) == 'undefined') ? '.save' : sel;
$(selector).off().click(function(e) {
e.preventDefault();
if ($(form).valid()) {
$(this).prop("disabled", true);
$(this).html($(this).data('loading-text'));
$(form).submit();
}
});
}
</script>
@endpush
@php(define('LOAD_SAVE', true))
@endonce