auto-centering of save location tooltip
This commit is contained in:
parent
ce9a508a12
commit
0891e7bada
6 changed files with 30 additions and 6 deletions
|
|
@ -966,14 +966,28 @@ SCROLL_BUTTON.addEventListener("click", () => {
|
|||
|
||||
document.getElementById("save-location-input").addEventListener("click", (e) => {
|
||||
|
||||
SelectCopyInputText(e, "save-location-input-tooltip", "Copied save location to clipboard");
|
||||
let tooltip = document.getElementById("save-location-input-tooltip");
|
||||
|
||||
SelectCopyInputText(e, "save-location-input-tooltip", "Copied save files location to clipboard");
|
||||
|
||||
let tooltipWidth = tooltip.offsetWidth;
|
||||
|
||||
/* make sure that the tooltip is centered */
|
||||
tooltip.style.marginLeft = `-${tooltipWidth / 2}px`;
|
||||
}, false);
|
||||
|
||||
/* -------------- Switch text back to the default on mouse out -------------- */
|
||||
|
||||
document.getElementById("save-location-input").addEventListener("mouseout", () => {
|
||||
|
||||
let tooltip = document.getElementById("save-location-input-tooltip");
|
||||
|
||||
FillInnerHTML("save-location-input-tooltip", "Click once to copy to clipboard");
|
||||
|
||||
let tooltipWidth = tooltip.offsetWidth;
|
||||
|
||||
/* make sure that the tooltip is centered */
|
||||
tooltip.style.marginLeft = `-${tooltipWidth / 2}px`;
|
||||
}, false);
|
||||
|
||||
/* ------------- Checkbox functions ---------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue