client/views: fix access key underline

This commit is contained in:
rr- 2016-04-14 20:24:22 +02:00
parent 35c549493c
commit 00bf279396

View file

@ -13,10 +13,11 @@ class TopNavView {
const target = this.navHolder;
const source = this.template(ctx);
for (let link of source.querySelectorAll('a span.text')) {
for (let link of source.querySelectorAll('a')) {
const regex = new RegExp(
'(' + link.getAttribute('accesskey') + ')', 'i');
link.innerHTML = link.textContent.replace(
const span = link.querySelector('span.text');
span.innerHTML = span.textContent.replace(
regex,
'<span class="access-key" data-accesskey="$1">$1</span>');
}