From 426b0dc636323d2d88f65f5405a57a0c3d623791 Mon Sep 17 00:00:00 2001 From: michael1011 Date: Thu, 29 Mar 2018 18:00:59 +0200 Subject: [PATCH] fixed bug which caused get invoice button to move up --- frontend/lightningTip.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 = "
";