From efa541b6d2d4ddd8055dfe5bc580547974e18ebf Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 19 Sep 2017 17:36:44 +0200 Subject: [PATCH] Keep device users on edit (closes #7) --- templates/dispositivo/show.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/dispositivo/show.htm b/templates/dispositivo/show.htm index b20910a..e9b6e5c 100644 --- a/templates/dispositivo/show.htm +++ b/templates/dispositivo/show.htm @@ -46,8 +46,8 @@ window.onload = function () { {% for accesso in accessi %} adduser(); - $("#utente{{ loop.index }} option").prop("selected", false); - $("#utente{{ loop.index }} option[value={{ accesso.iid }}]").prop("selected", true); + $("#utente{{ loop.index - 1 }} option").prop("selected", false); + $("#utente{{ loop.index - 1 }} option[value={{ accesso.iid }}]").prop("selected", true); {% endfor %} }; {% endif %}