Merge pull request #422 from yueyuzhao/issue/420-large-count-options2

change column-count by optionNum on init options page
This commit is contained in:
chrisgarrity 2021-05-25 09:44:30 -04:00 committed by GitHub
commit 0be5e272a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -273,6 +273,15 @@ function indexShowQuestion (key) {
}
optionNum = optionNum + 1;
});
// iPad mini has the minimum screen size, it can show 13 items in one column
// and we use 3 columns as default
if (optionNum > 13 * 5) {
gn('optionsList').style['column-count'] = 8;
} else if (optionNum > 13 * 3) {
gn('optionsList').style['column-count'] = 5;
} else {
gn('optionsList').style['column-count'] = 3;
}
gn('optionsList').className = 'optionsList show';
}
}