From d97b45cd96a293ba3f2c8e406ea19f1bb2aa0616 Mon Sep 17 00:00:00 2001 From: James Fournie Date: Thu, 2 May 2019 09:53:35 -0700 Subject: [PATCH] LP1751800 - fix fields fields reversing The pop() here will remove the last item in the array, only to add it later with a push() a few lines later. Instead use a shift() to preserve the order. Signed-off-by: James Fournie Signed-off-by: Remington Steed Signed-off-by: Dan Wells --- Open-ILS/web/js/ui/default/staff/reporter/services/template.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/staff/reporter/services/template.js b/Open-ILS/web/js/ui/default/staff/reporter/services/template.js index 043dd47638..39086549ec 100644 --- a/Open-ILS/web/js/ui/default/staff/reporter/services/template.js +++ b/Open-ILS/web/js/ui/default/staff/reporter/services/template.js @@ -406,7 +406,7 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) { service.removeField = function (type, field) { var new_list = []; while (service[type].length) { - var f = service[type].pop(); + var f = service[type].shift(); if (field.index != f.index ) new_list.push(f); } new_list.forEach(function(f) { -- 2.11.0