From ec18d1ff92d6e8825392903dfc6516918508d00c Mon Sep 17 00:00:00 2001 From: Yueyu Date: Thu, 13 May 2021 19:33:38 +0800 Subject: [PATCH 1/2] touch to click on init options page --- src/entry/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/entry/index.js b/src/entry/index.js index 0b4ec84..77286cc 100644 --- a/src/entry/index.js +++ b/src/entry/index.js @@ -203,7 +203,7 @@ function indexHidePlaceQuestion () { gn('usageNoanswer').className = 'usageNoanswer hide'; } -function optionTouched (elem) { +function optionSelected (elem) { var key = elem.target.getAttribute('data-key'); var value = elem.target.getAttribute('data-value'); // sometimes a touch is registered by a child of the relevant parent @@ -212,6 +212,7 @@ function optionTouched (elem) { key = parent.getAttribute('data-key'); value = parent.getAttribute('data-value'); } + console.log(key, value) // if we still don't have a key and value, something is wrong -- just go // to lobby if (!key && !value) { @@ -255,7 +256,7 @@ function indexShowQuestion (key) { optionElem.setAttribute('data-key', key); optionElem.setAttribute('data-value', option); optionElem.setAttribute('id', 'option-' + key + '-' + optionNum); - optionElem.ontouchend = optionTouched; + optionElem.onclick = optionSelected; optionsListElem.appendChild(optionElem); switch (optionType) { From 267d09bc879781885371ff0c3af9aa060f618454 Mon Sep 17 00:00:00 2001 From: Yueyu Date: Thu, 13 May 2021 19:39:03 +0800 Subject: [PATCH 2/2] clean up --- src/entry/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/entry/index.js b/src/entry/index.js index 77286cc..7921468 100644 --- a/src/entry/index.js +++ b/src/entry/index.js @@ -212,7 +212,6 @@ function optionSelected (elem) { key = parent.getAttribute('data-key'); value = parent.getAttribute('data-value'); } - console.log(key, value) // if we still don't have a key and value, something is wrong -- just go // to lobby if (!key && !value) {