X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/edb313a940627abab92ecc67a953502043346b94..3d1587c2e784bae0642f9d788d82936282ca61ea:/searchlocal.js diff --git a/searchlocal.js b/searchlocal.js index 4de1423..2993a4a 100644 --- a/searchlocal.js +++ b/searchlocal.js @@ -1,7 +1,8 @@ function filtertable(query, action) { var rows = document.getElementsByTagName('TBODY')[0].rows; for (var i = 0; i < rows.length; i++) { - var keep = rows[i].cells[1].textContent.match(query, query.match(/[A-Z]/) ? '' : 'i'); + var keep = query.match(/^[A-Z0-9 ]{2,}$/) ? rows[i].cells[0].title.match(query, 'i') + : rows[i].cells[1].textContent.match(query, query.match(/[A-Z]/) ? '' : 'i'); switch (action) { case 'focus': rows[i].classList[keep ? 'add' : 'remove'](action);