git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
browser: search categories on uppercase form input
[sheet.git]
/
searchlocal.js
diff --git
a/searchlocal.js
b/searchlocal.js
index 4de1423677d8e61b81e108a0b22c7e4d115e6b32..2993a4a96fa83261ac0833dede4132f3a4fc03cb 100644
(file)
--- 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++) {
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);
switch (action) {
case 'focus':
rows[i].classList[keep ? 'add' : 'remove'](action);