From 515b14a001db1e83c008bf8e66c2f279fb7d175d Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 20 Oct 2022 19:21:09 -0700 Subject: [PATCH] Updated JS to better handle input IDs Signed-off-by: snipe --- .../views/partials/bootstrap-table.blade.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index c9e682dc8..57ac6a4d7 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -116,32 +116,30 @@ // These methods dynamically add/remove hidden input values in the bulk actions form $('.snipe-table').on('check.bs.table .btSelectItem', function (row, $element) { var buttonName = $(this).data('bulk-button-id'); - var formName = $(this).data('bulk-form-id'); var tableId = $(this).data('id-table'); $(buttonName).removeAttr('disabled'); - $(formName).append(''); + $(buttonName).after(''); }); - $('.snipe-table').on('uncheck.bs.table .btSelectItem', function (row, $element) { - var tableId = $(this).data('id-table'); - $( "#" + tableId + "_checkbox_" + $element.id).remove(); - }); - - $('.snipe-table').on('check-all.bs.table', function (event, rowsAfter) { var buttonName = $(this).data('bulk-button-id'); $(buttonName).removeAttr('disabled'); - var formName = $(this).data('bulk-form-id'); var tableId = $(this).data('id-table'); for (var i in rowsAfter) { - $(formName).append(''); + $(buttonName).after(''); } }); + $('.snipe-table').on('uncheck.bs.table .btSelectItem', function (row, $element) { + var tableId = $(this).data('id-table'); + $( "#" + tableId + "_checkbox_" + $element.id).remove(); + }); + + // Handle whether or not the edit button should be disabled $('.snipe-table').on('uncheck.bs.table', function () {