From f158eb6f45a32d233208647b2dc171443dc5fe74 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Tue, 1 Jun 2021 13:42:58 -0300 Subject: [PATCH] prevent selecting filenames under icons --- navigator/navigator.css | 9 +++++++++ navigator/navigator.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/navigator/navigator.css b/navigator/navigator.css index d2be5b6..5ceb3eb 100644 --- a/navigator/navigator.css +++ b/navigator/navigator.css @@ -127,6 +127,15 @@ body::-webkit-scrollbar-thumb { border: 3px solid var(--scrollbar-bg); } +.no-select { + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */ +} + .flex-row { display: flex; flex-direction: row; diff --git a/navigator/navigator.js b/navigator/navigator.js index 80f2d0b..b7459cf 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -156,7 +156,7 @@ class NavEntry { let icon = this.dom_element.nav_item_icon = document.createElement("i"); icon.classList.add("nav-item-icon"); let title = this.dom_element.nav_item_title = document.createElement("div"); - title.classList.add("nav-item-title"); + title.classList.add("nav-item-title", "no-select"); title.innerText = this.filename(); this.dom_element.appendChild(icon); this.dom_element.appendChild(title);