Fix button events not firing

This commit is contained in:
Skylar Ittner 2021-10-09 15:43:18 -06:00
parent 08a30d6c52
commit 1e8f1a25ae
2 changed files with 6 additions and 6 deletions

View File

@ -131,7 +131,7 @@ function displayAccountInfo() {
}, "GET");
}
$("#app").on("click", "#setupAccountBtn", function () {
$("body").on("click", "#setupAccountBtn", function () {
if ($("#accountsetupform input#phonenumber").val() == "") {
app.dialog.alert("Add your phone number.", "Error");
return;
@ -175,7 +175,7 @@ $("#app").on("click", "#setupAccountBtn", function () {
});
});
$("#app").on("click", "#updateAccountBtn", function () {
$("body").on("click", "#updateAccountBtn", function () {
if ($("#accountupdateform input#name").val() == "") {
app.dialog.alert("Add your name.", "Error");
return;
@ -218,7 +218,7 @@ $("#app").on("click", "#updateAccountBtn", function () {
});
});
$("#app").on("click", "#connectExistingAccountBtn", function () {
$("body").on("click", "#connectExistingAccountBtn", function () {
app.dialog.prompt("Enter your phone number or account number:", "Connect Your Account", function (val) {
var phone = val.replace(/\D/g, '');
if (phone.length < 10) {

View File

@ -242,7 +242,7 @@ function initCordova() {
}, false);
// Handle geo: urls
$("#app").on("click", "a[href^='geo:']", function (evt) {
$("body").on("click", "a[href^='geo:']", function (evt) {
if (cordova.platformId == "ios") {
window.open($(this).attr("href").replace("geo:", "http://maps.apple.com/?q="), "_system");
} else if (cordova.platformId == "android") {
@ -293,7 +293,7 @@ function initNW() {
setupHTML5BarcodeScanner();
// Handle geo: urls
$("#app").on("click", "a[href^='geo:']", function (evt) {
$("body").on("click", "a[href^='geo:']", function (evt) {
require('nw.gui').Shell.openExternal($(this).attr("href"));
evt.preventDefault();
});
@ -320,7 +320,7 @@ function initBrowser() {
setupHTML5BarcodeScanner();
$("#app").on("click", ".geolink", function (evt) {
$("body").on("click", ".geolink", function (evt) {
window.open($(this).attr("href"), "_blank");
evt.preventDefault();
});