Use the shorthand when I have it.

This commit is contained in:
Rasmus Kaj 2017-11-26 21:31:48 +01:00
parent a63e9a3258
commit c099f7950e

6
ux.js
View File

@ -3,13 +3,13 @@
f.insertAdjacentHTML(
'afterbegin',
'<p><a href="#help" title="Help" accesskey="?">?</a></p>')
document.querySelector('[href="#help"]').onclick = e => {
if (document.getElementById('help') == null) {
d.querySelector('[href="#help"]').onclick = e => {
if (d.getElementById('help') == null) {
f.insertAdjacentHTML(
'beforebegin',
'<div id="help"><h2>Key bindings</h2>' +
[].map.call(
document.querySelectorAll('[accesskey]'),
d.querySelectorAll('[accesskey]'),
e => e.accessKeyLabel + ": " + (e.title || e.innerText)).join('<br/>') +
'</div>');
}