Merge pull request #424 from yueyuzhao/issue/423-touch-to-click

touch to click on init options page
This commit is contained in:
chrisgarrity 2021-05-25 09:56:08 -04:00 committed by GitHub
commit 70c89eee68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,7 +203,7 @@ function indexHidePlaceQuestion () {
gn('usageNoanswer').className = 'usageNoanswer hide'; gn('usageNoanswer').className = 'usageNoanswer hide';
} }
function optionTouched (elem) { function optionSelected (elem) {
var key = elem.target.getAttribute('data-key'); var key = elem.target.getAttribute('data-key');
var value = elem.target.getAttribute('data-value'); var value = elem.target.getAttribute('data-value');
// sometimes a touch is registered by a child of the relevant parent // sometimes a touch is registered by a child of the relevant parent
@ -255,7 +255,7 @@ function indexShowQuestion (key) {
optionElem.setAttribute('data-key', key); optionElem.setAttribute('data-key', key);
optionElem.setAttribute('data-value', option); optionElem.setAttribute('data-value', option);
optionElem.setAttribute('id', 'option-' + key + '-' + optionNum); optionElem.setAttribute('id', 'option-' + key + '-' + optionNum);
optionElem.ontouchend = optionTouched; optionElem.onclick = optionSelected;
optionsListElem.appendChild(optionElem); optionsListElem.appendChild(optionElem);
switch (optionType) { switch (optionType) {