1
Fork 0

Make spotlight show on hover

This makes the spotlight show on hover instead of click. Clicks can be
used to persist it, which is also what's used on mobile.
This commit is contained in:
Manish Goregaokar 2020-07-06 17:18:04 -07:00
parent c90fb7185a
commit 734afb4830
5 changed files with 53 additions and 156 deletions

View file

@ -2639,28 +2639,13 @@ function defocusSearchBar() {
});
}());
function showModal(content) {
var modal = document.createElement("div");
modal.id = "important";
addClass(modal, "modal");
modal.innerHTML = "<div class=\"modal-content\"><div class=\"close\" id=\"modal-close\">✕" +
"</div><div class=\"whiter\"></div><span class=\"docblock\">" + content +
"</span></div>";
document.getElementsByTagName("body")[0].appendChild(modal);
document.getElementById("modal-close").onclick = hideModal;
modal.onclick = hideModal;
}
function hideModal() {
var modal = document.getElementById("important");
if (modal) {
modal.parentNode.removeChild(modal);
}
function showImportantTraits(content) {
let list = content.classList
}
onEachLazy(document.getElementsByClassName("important-traits"), function(e) {
e.onclick = function() {
showModal(e.lastElementChild.innerHTML);
e.getElementsByClassName('important-traits-tooltiptext')[0].classList.toggle("force-tooltip")
};
});