treehouse/static/js/usability.js

10 lines
335 B
JavaScript
Raw Normal View History

2023-08-18 17:04:12 +02:00
// Bits and pieces to make vanilla HTML just a bit more usable.
// We want to let the user have a selection on collapsible blocks without collapsing them when
// the user finishes marking their selection.
document.addEventListener("click", event => {
if (getSelection().type == "Range") {
event.preventDefault();
}
})