@@ -, +, @@
---
.../prog/en/modules/reserve/request.tt | 25 ++++++++++++++++------
reserve/request.pl | 8 ++++++-
2 files changed, 25 insertions(+), 8 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
@@ -169,16 +169,21 @@ function checkMultiHold() {
}).change(function() {
var row = $(this).parents("tr:first");
var value = parseInt($(this).val());
- var after = row.parent().find("tr:nth-child("+(value+1)+")");
-
- if (prev_rank_request > value) {
- row.insertBefore(after);
- } else {
- row.insertAfter(after);
+ var found_holds = $("select[name='rank-request'][disabled='disabled']").length ; //Count how many are found
+
+ if( !isNaN(value) ) { //If moved to 'del'
+ var after = row.parent().find("tr:nth-child("+(value+1+found_holds)+")");
+ //Go to the row 1 after the new value (and skip found holds)
+ if (prev_rank_request > value) {
+ row.insertBefore(after);
+ } else {
+ row.insertAfter(after);
+ }
}
var next_priority = 1;
$("select[name=rank-request]").each(function () {
+ if( isNaN( $(this).val() ) ){ return true; } //Don't reset found or del holds
$(this).val(next_priority);
next_priority++;
});
@@ -757,7 +762,12 @@ function checkMultiHold() {
-