Skip to content

Commit

Permalink
fixed bug which caused get invoice button to move up
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 committed Mar 29, 2018
1 parent 91b11e4 commit 426b0dc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions frontend/lightningTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 = "<div class='spinner'></div>";
Expand Down

0 comments on commit 426b0dc

Please sign in to comment.