[Koha-bugs] [Bug 34871] Highlight scanned item in holdings table when searching
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Sep 21 22:24:28 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34871
--- Comment #1 from Andrew Fuerste-Henry <andrewfh at dubcolib.org> ---
We're currently accomplishing this with the following jquery:
$(document).ready(function () {
if ( $('#catalog_detail').length &&
window.location.href.indexOf("found1=1") > -1 ) {
setTimeout(function() {
let search_value = $('#search-form').val().trim();
let barcode_index = $('th:contains("Barcode")').index() +1; //add one
for nth-child
$('#holdings_table tbody tr td:nth-child('+barcode_index+')').each(
function() {
if ( $(this).text() === search_value ) {
$(this).parent().addClass('found_bc');
$(this).parent().children('td').css('background' , 'khaki');
}
})
//now clear the search form
if ( $('#cat-search-block').length ) {
$('#search-form').val('');
localStorage.setItem('searchbox_value', '');
$('#search-form').focus();
}
}, 100);
}
});
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list