deselect all, style tooltip

This commit is contained in:
ReznoRMichael 2021-01-31 00:37:19 +01:00
commit 301e0ac32e
4 changed files with 29 additions and 18 deletions

View file

@ -1050,6 +1050,11 @@ function SelectCopyInputText(mouseEvent, tooltipId = "", tooltipFill = "") {
const element = document.getElementById(mouseEvent.target.id);
// this prevents the un-selected effect after clicking the second time (clears all selection first)
if (window.getSelection) {
window.getSelection().removeAllRanges();
}
element.focus(); // best to focus the element first before selecting
element.select();
element.setSelectionRange(0, 99999); // for mobile devices
@ -1061,7 +1066,7 @@ function SelectCopyInputText(mouseEvent, tooltipId = "", tooltipFill = "") {
}
function ShowTooltip(tooltipId, tooltipFill) {
const tooltip = document.getElementById(tooltipId);
tooltip.innerHTML = tooltipFill;
}