Answer the question
In order to leave comments, you need to log in
How to view a remote repository on heroku?
How to see a remote repository on heroku, or better yet, connect to it?
When you run ./node_modules/.bin/babel-node server.js, it says that the module was not found, everything is fine on the local...
Answer the question
In order to leave comments, you need to log in
const focusedCallbacks = new WeakMap();
document.addEventListener('click', (e) => {
let target = e.target,
open = target.dataset.open ? target.dataset.open : 0,
close = target.dataset.close ? target.dataset.close : 0,
element = open || close ? document.querySelector(`[data-window=${open || close}]`) : 0,
if (open) {
element.classList.add(`${element.dataset.window}-open`);
focusedCallback.set(element,trapFocus.bind(null, element));
element.addEventListener('keydown', focusedCallback.get(element));
}
if (close) {
element.classList.remove(`${element.dataset.window}-open`);
element.removeEventListener('keydown', focusedCallback.get(element));
focusedCallback.delete(element);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question