Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorVinzenz <vinzenz.rosenkranz@gmail.com>2016-08-22 21:05:53 +0300
committerVinzenz <vinzenz.rosenkranz@gmail.com>2016-08-22 21:05:53 +0300
commit30db8e9f663ccab0f072713227d623843029f74a (patch)
tree6c650331d38ac7742b2617b709333035534efa1e /js
parent997dc2f2247dd88ec5b6b82f2a8d05664a21b5e4 (diff)
fix preselection on edit poll
Diffstat (limited to 'js')
-rw-r--r--js/create_edit.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/create_edit.js b/js/create_edit.js
index ca07ecc2..a2beb9d3 100644
--- a/js/create_edit.js
+++ b/js/create_edit.js
@@ -366,8 +366,14 @@ function addRowToList(ts, text, timeTs) {
var curr;
for(var i=1; i<rows.length; i++) {
curr = rows[i];
- if(curr.id == ts) return; //already in table, cancel
- if(curr.id > ts) {
+ if(curr.id == ts) {
+ for(var j=1; j<curr.cells.length; j++) {
+ var td = curr.cells[j];
+ var tdId = curr.cells[j].id;
+ if(timeTs == tdId) td.className = 'icon-checkmark date-text-selected';
+ }
+ return; //already in table, cancel
+ } else if(curr.id > ts) {
var tr = table.insertRow(i); //insert row at current index
tr.id = ts;
tr.className = 'toggleable-row';