change the text and center only when the text was different
This commit is contained in:
parent
0891e7bada
commit
7a57bfcbac
3 changed files with 18 additions and 16 deletions
14
build/app.js
14
build/app.js
|
|
@ -7054,20 +7054,22 @@ SCROLL_BUTTON.addEventListener("click", function () {
|
|||
document.getElementById("save-location-input").addEventListener("click", function (e) {
|
||||
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");
|
||||
tooltip.style.marginLeft = "-".concat(tooltip.offsetWidth / 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 */
|
||||
/* change the text and center only when the text was different */
|
||||
|
||||
tooltip.style.marginLeft = "-".concat(tooltipWidth / 2, "px");
|
||||
if (tooltip.innerHTML !== "Click once to copy to clipboard") {
|
||||
FillInnerHTML("save-location-input-tooltip", "Click once to copy to clipboard");
|
||||
/* make sure that the tooltip is centered */
|
||||
|
||||
tooltip.style.marginLeft = "-".concat(tooltip.offsetWidth / 2, "px");
|
||||
}
|
||||
}, false);
|
||||
/* ------------- Checkbox functions ---------------------- */
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -970,10 +970,8 @@ document.getElementById("save-location-input").addEventListener("click", (e) =>
|
|||
|
||||
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`;
|
||||
tooltip.style.marginLeft = `-${tooltip.offsetWidth / 2}px`;
|
||||
}, false);
|
||||
|
||||
/* -------------- Switch text back to the default on mouse out -------------- */
|
||||
|
|
@ -982,12 +980,14 @@ 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");
|
||||
/* change the text and center only when the text was different */
|
||||
if (tooltip.innerHTML !== "Click once to copy to clipboard") {
|
||||
|
||||
let tooltipWidth = tooltip.offsetWidth;
|
||||
FillInnerHTML("save-location-input-tooltip", "Click once to copy to clipboard");
|
||||
|
||||
/* make sure that the tooltip is centered */
|
||||
tooltip.style.marginLeft = `-${tooltipWidth / 2}px`;
|
||||
/* make sure that the tooltip is centered */
|
||||
tooltip.style.marginLeft = `-${tooltip.offsetWidth / 2}px`;
|
||||
}
|
||||
}, false);
|
||||
|
||||
/* ------------- Checkbox functions ---------------------- */
|
||||
|
|
|
|||
Loading…
Reference in a new issue