Skip to content

Commit

Permalink
scoring: Fix button issue with Android Chrome
Browse files Browse the repository at this point in the history
Clicking a button would cause the button to shrink on
Android (at least on my Nexus and device Danny was using).
  • Loading branch information
courtney-g committed Sep 27, 2014
1 parent 5014e3f commit 3a1814d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions world_class_scoring.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@
validate();
});
}

if (navigator.userAgent.indexOf("Android") != -1) {
// Hack for Android Chrome weirdness
// Bug is that the padding value is lost when button clicked, so
// we'll capture the initial padding value and apply it to all
// the buttons when they are created, this seems to work around the issue.
myElements = document.getElementsByClassName("ui-button-text");
pad_val = window.getComputedStyle(myElements[0]).padding;
for (var i = 0; i < myElements.length; i++) {
myElements[i].style.padding=pad_val;
}
}

// Make button click happen with mousedown
// Allows for faster entry on computer
// This must happen after the buttons have been added to the DOM
Expand Down

0 comments on commit 3a1814d

Please sign in to comment.