auto-centering of save location tooltip

This commit is contained in:
ReznoRMichael 2021-07-27 23:17:38 +02:00
parent ce9a508a12
commit 0891e7bada
6 changed files with 30 additions and 6 deletions

View file

@ -7052,12 +7052,22 @@ SCROLL_BUTTON.addEventListener("click", function () {
/* ------------- Auto select & copy to clipboard when the save file location input text is clicked once ------------- */
document.getElementById("save-location-input").addEventListener("click", function (e) {
SelectCopyInputText(e, "save-location-input-tooltip", "Copied save location to clipboard");
var tooltip = document.getElementById("save-location-input-tooltip");
SelectCopyInputText(e, "save-location-input-tooltip", "Copied save files location to clipboard");
var tooltipWidth = tooltip.offsetWidth;
/* make sure that the tooltip is centered */
tooltip.style.marginLeft = "-".concat(tooltipWidth / 2, "px");
}, false);
/* -------------- Switch text back to the default on mouse out -------------- */
document.getElementById("save-location-input").addEventListener("mouseout", function () {
var tooltip = document.getElementById("save-location-input-tooltip");
FillInnerHTML("save-location-input-tooltip", "Click once to copy to clipboard");
var tooltipWidth = tooltip.offsetWidth;
/* make sure that the tooltip is centered */
tooltip.style.marginLeft = "-".concat(tooltipWidth / 2, "px");
}, false);
/* ------------- Checkbox functions ---------------------- */

File diff suppressed because one or more lines are too long

View file

@ -863,7 +863,7 @@ input[type="radio"]:focus + label {
z-index: 1;
bottom: 130%;
left: 50%;
margin-left: -109px;
margin-left: -108.5px;
opacity: 0;
transition: opacity 0.3s;
}

File diff suppressed because one or more lines are too long

View file

@ -755,7 +755,7 @@ input[type="radio"]:focus + label {
z-index: 1;
bottom: 130%;
left: 50%;
margin-left: -109px;
margin-left: -108.5px;
opacity: 0;
transition: opacity 0.3s;
}

View file

@ -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 ---------------------- */