A free open source IT asset/license management system
Updated JS to better handle input IDs
snipe515b14a001db
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.phpindex c9e682dc87..57ac6a4d7e 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('<input id="' + tableId + '_checkbox_' + $element.id + '" type="hidden" name="ids[]" value="' + $element.id + '">');+ $(buttonName).after('<input id="' + tableId + '_checkbox_' + $element.id + '" type="hidden" name="ids[]" value="' + $element.id + '">');});- $('.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('<input id="' + tableId + '_checkbox_' + rowsAfter[i].id + '" type="hidden" name="ids[]" value="' + rowsAfter[i].id + '">');+ $(buttonName).after('<input id="' + tableId + '_checkbox_' + rowsAfter[i].id + '" type="hidden" name="ids[]" value="' + rowsAfter[i].id + '">');}});+ $('.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 () {