Improve javascript ux.

This commit is contained in:
Rasmus Kaj 2017-12-25 16:43:06 +01:00
parent 0a6a7f8f1c
commit 691c4952d8
2 changed files with 9 additions and 8 deletions

View File

@ -161,14 +161,15 @@ form {
}
#help {
position: fixed;
bottom: 2em;
left: 2em;
border: solid 1px black;
padding: 1ex 1em;
background: #fafafa;
border: solid 1px black;
bottom: 2em;
box-shadow: .3em .2em 1em;
display: none;
left: 2em;
padding: 1ex 1em;
position: fixed;
z-index: 1111;
&:target {
display: block;

6
ux.js
View File

@ -3,7 +3,7 @@
f.insertAdjacentHTML(
'afterbegin',
'<p><a href="#help" title="Help" accesskey="?">?</a></p>')
d.querySelector('[href="#help"]').onclick = e => {
f.querySelector('[href="#help"]').addEventListener('click', e => {
if (d.getElementById('help') == null) {
f.insertAdjacentHTML(
'beforebegin',
@ -14,8 +14,8 @@
'</div>');
}
return true;
};
let i = document.querySelector('.details .item');
});
let i = d.querySelector('.details .item');
if (i) {
i.addEventListener('click', e => { i.classList.toggle('zoom') });
}