From 107dc4aa4f14d38438c7a5c8a768212f1b1becf9 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 27 Apr 2018 09:21:28 +0000 Subject: [PATCH] Bug 19469 [QA Followup]: When altering priorities, use the existing priority numbers of the given table --- koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 6b04892b3b..de06a44f7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -796,8 +796,13 @@ } }); var prev_rank_request; + var priorities; $("select[name=rank-request]").on("focus", function() { prev_rank_request = $(this).val(); + var row = $(this).parents("tr:first"); + priorities = row.parent().find("select[name=rank-request]").map( function() { + return $(this).val(); + }).get(); }).change(function() { var row = $(this).parents("tr:first"); var value = parseInt($(this).val()); @@ -811,9 +816,9 @@ row.insertAfter(after); } - var next_priority = 1; + var next_priority = 0; row.parent().find("select[name=rank-request]").each(function () { - $(this).val(next_priority); + $(this).val(priorities[next_priority]); next_priority++; }); }); -- 2.11.0