From c17fc2efe7e7f12e0bdfea46208eb15952974da2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 23 Oct 2017 14:53:31 +0200 Subject: [PATCH] improve option order in poll --- www/poll/inner.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/www/poll/inner.js b/www/poll/inner.js index ea7fc4e89..7ae98bbfd 100644 --- a/www/poll/inner.js +++ b/www/poll/inner.js @@ -526,6 +526,14 @@ define([ } }; + var optionOrder = { + 3: 1, // ? => ✔ + 1: 2, // ✔ => ~ + 2: 0, // ~ => x + 0: 3, // x => ? + // undefined => 3 + }; + var handleClick = function (e, isKeyup) { if (APP.readOnly) { return; } @@ -566,8 +574,7 @@ define([ case 'LABEL': var input = $('input[type="number"][id=' + $(target).attr('for') + ']'); var value = parseInt(input.val()); - - input.val((value + 1) % 4); + input.val(optionOrder[value]); handleInput(input[0]); break;