diff --git a/frontend/lightningTip.js b/frontend/lightningTip.js index 0805dd3..2a1c796 100644 --- a/frontend/lightningTip.js +++ b/frontend/lightningTip.js @@ -8,6 +8,14 @@ var qrCode; var defaultGetInvoice; +// Fixes weird bug which moved the button up one pixel when its content was changed +window.onload = function () { + var button = document.getElementById("lightningTipGetInvoice"); + + button.style.height = button.clientHeight + "px"; + button.style.width = button.clientWidth + "px"; +}; + // TODO: maybe don't show full invoice // TODO: show price in dollar? function getInvoice() { @@ -85,9 +93,6 @@ function getInvoice() { var button = document.getElementById("lightningTipGetInvoice"); - button.style.height = button.clientHeight + "px"; - button.style.width = button.clientWidth + "px"; - defaultGetInvoice = button.innerHTML; button.innerHTML = "
";