touch to click on init options page

This commit is contained in:
Yueyu 2021-05-13 19:33:38 +08:00
parent 8c5e099337
commit ec18d1ff92

View file

@ -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) {