git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c60392
)
keys: speed up javascript search for header title
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 18 Jun 2017 07:50:25 +0000
(09:50 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 17 Jul 2017 15:13:43 +0000
(17:13 +0200)
Ignore subsequent headers to avoid duplicate work.
keys.js
patch
|
blob
|
history
diff --git
a/keys.js
b/keys.js
index 993e8f458cc76ae300971d4c9532a2beb2f6d7af..5dc2e2d2979d8027800055af47aa093c2d382fcc 100644
(file)
--- a/
keys.js
+++ b/
keys.js
@@
-11,7
+11,9
@@
function setmode(classname) {
var h3s = document.getElementsByTagName('TH');
for (var i = 0; i < h3s.length; i++) {
if (h3s[i].parentNode.style.display != 'block') continue;
- document.getElementsByTagName('H2')[0].innerHTML = h3s[i].firstChild.data;
+ var header = h3s[i].firstChild.data;
+ document.getElementsByTagName('H2')[0].innerHTML = header;
+ break;
}
}