From 3293e506ca92894632eba5fc8866c54253b41ecf Mon Sep 17 00:00:00 2001 From: Yueyu Date: Thu, 13 May 2021 18:38:49 +0800 Subject: [PATCH] set column-count by optionNum --- src/entry/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/entry/index.js b/src/entry/index.js index 0b4ec84..23aeeff 100644 --- a/src/entry/index.js +++ b/src/entry/index.js @@ -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'; } }