| ... | ... |
@@ -58,8 +58,6 @@ |
| 58 | 58 |
<form hx-post="/_ajax/vr_wa/v1/slot?do=updateCheckin" enctype="multipart/form-data"> |
| 59 | 59 |
<input type="hidden" name="id" value="{{ id }}">
|
| 60 | 60 |
|
| 61 |
- <button type="button" id="load-numbers-btn" class="btn btn--sm btn-info mb-2">Nummern laden</button> |
|
| 62 |
- |
|
| 63 | 61 |
<!-- Datalist for all behaelter number inputs --> |
| 64 | 62 |
<datalist id="behaelter-numbers-list"> |
| 65 | 63 |
<!-- Options will be loaded via Ajax --> |
| ... | ... |
@@ -713,34 +711,6 @@ |
| 713 | 711 |
$form.prepend($toast); |
| 714 | 712 |
}); |
| 715 | 713 |
}); |
| 716 |
- |
|
| 717 |
- // Add click handler to the load numbers button |
|
| 718 |
- $('#load-numbers-btn').on('click', function(e) {
|
|
| 719 |
- e.preventDefault(); |
|
| 720 |
- |
|
| 721 |
- // Add loading animation to button |
|
| 722 |
- var $btn = $(this); |
|
| 723 |
- var originalText = $btn.text(); |
|
| 724 |
- $btn.html('<div class="loading-spinner" style="display: inline-block;"></div> Wird geladen...').prop('disabled', true);
|
|
| 725 |
- |
|
| 726 |
- // Store original button state |
|
| 727 |
- var restoreButton = function() {
|
|
| 728 |
- $btn.html(originalText).prop('disabled', false);
|
|
| 729 |
- }; |
|
| 730 |
- |
|
| 731 |
- // Override the complete callback of the Ajax request |
|
| 732 |
- var originalComplete = $.ajax.prototype.complete; |
|
| 733 |
- $.ajax.prototype.complete = function() {
|
|
| 734 |
- restoreButton(); |
|
| 735 |
- $.ajax.prototype.complete = originalComplete; |
|
| 736 |
- return originalComplete.apply(this, arguments); |
|
| 737 |
- }; |
|
| 738 |
- |
|
| 739 |
- loadAvailableNumbers(); |
|
| 740 |
- |
|
| 741 |
- // Fallback in case the Ajax request fails or takes too long |
|
| 742 |
- setTimeout(restoreButton, 10000); |
|
| 743 |
- }); |
|
| 744 | 714 |
} |
| 745 | 715 |
|
| 746 | 716 |
})(jQuery); |