Fix búsqueda en tiempo real, paginación, OneSignal, bancos/categorías y vistas auth
- ajaxcrud.js: fix race condition en búsqueda, abort de requests en vuelo
- Layout: mover @yield('js') después de app.js para corregir orden de carga
- Paginación: useBootstrapFour() + eliminar wrappers <ul> duplicados en 17 vistas
- OneSignal: migrar de UserTag iChamba_ID a ExternalId en controladores
- API: agregar endpoint GET /api/banks y campos rfc/bank/bank_account/fee en hero()
- Seeders: BanksSeeder (239 bancos) y CategoriesSeeder (100 categorías)
- Auth views: corregir padding/scroll en register, login, password reset
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -126,7 +126,7 @@
|
||||
height="55.717773"
|
||||
width="209.07556"
|
||||
id="rect863"
|
||||
style="fill:#0080ff;fill-opacity:1;stroke-width:5.09377;stroke-linecap:round;stroke-linejoin:round" />
|
||||
style="fill:none;fill-opacity:0;stroke-width:5.09377;stroke-linecap:round;stroke-linejoin:round" />
|
||||
<text
|
||||
style="font-style:normal;font-weight:normal;font-size:10.5833px;line-height:1.25;font-family:sans-serif;white-space:pre;shape-inside:url(#rect1190);fill:#000000;fill-opacity:1;stroke:none;"
|
||||
id="text1188"
|
||||
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
43
public/js/ajaxcrud.js
vendored
43
public/js/ajaxcrud.js
vendored
@@ -1,8 +1,26 @@
|
||||
$(document).on('click', 'pagination a', function (event) {
|
||||
$(document).on('click', '.pagination a', function (event) {
|
||||
event.preventDefault();
|
||||
ajaxLoad($(this).attr('href'));
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form[method="GET"]', function (event) {
|
||||
event.preventDefault();
|
||||
ajaxLoad($(this).attr('action') + '?' + $(this).serialize());
|
||||
});
|
||||
|
||||
var searchTimer;
|
||||
$(document).on('keyup', 'input[name="search"]', function () {
|
||||
var form = $(this).closest('form');
|
||||
clearTimeout(searchTimer);
|
||||
if (activeRequest) {
|
||||
activeRequest.abort();
|
||||
activeRequest = null;
|
||||
}
|
||||
searchTimer = setTimeout(function () {
|
||||
ajaxLoad(form.attr('action') + '?' + form.serialize());
|
||||
}, 400);
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form#frm', function (event) {
|
||||
event.preventDefault();
|
||||
var form = $(this);
|
||||
@@ -33,19 +51,36 @@ $(document).on('submit', 'form#frm', function (event) {
|
||||
return false;
|
||||
});
|
||||
|
||||
var activeRequest = null;
|
||||
|
||||
function ajaxLoad(filename, content) {
|
||||
content = typeof content !== 'undefined' ? content : 'content';
|
||||
var searchFocused = $('input[name="search"]').is(':focus');
|
||||
|
||||
if (activeRequest) {
|
||||
activeRequest.abort();
|
||||
}
|
||||
|
||||
$('.loading').show();
|
||||
$.ajax({
|
||||
activeRequest = $.ajax({
|
||||
type: "GET",
|
||||
url: filename,
|
||||
contentType: false,
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
success: function (data) {
|
||||
activeRequest = null;
|
||||
$("#" + content).html(data);
|
||||
$('.loading').hide();
|
||||
if (searchFocused) {
|
||||
var input = $('input[name="search"]');
|
||||
input.focus();
|
||||
var len = input.val().length;
|
||||
input[0].setSelectionRange(len, len);
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
alert(xhr.responseText);
|
||||
if (status !== 'abort') {
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user