Lines 796-803
Link Here
|
796 |
} |
796 |
} |
797 |
}); |
797 |
}); |
798 |
var prev_rank_request; |
798 |
var prev_rank_request; |
|
|
799 |
var priorities; |
799 |
$("select[name=rank-request]").on("focus", function() { |
800 |
$("select[name=rank-request]").on("focus", function() { |
800 |
prev_rank_request = $(this).val(); |
801 |
prev_rank_request = $(this).val(); |
|
|
802 |
var row = $(this).parents("tr:first"); |
803 |
priorities = row.parent().find("select[name=rank-request]").map( function() { |
804 |
return $(this).val(); |
805 |
}).get(); |
801 |
}).change(function() { |
806 |
}).change(function() { |
802 |
var row = $(this).parents("tr:first"); |
807 |
var row = $(this).parents("tr:first"); |
803 |
var value = parseInt($(this).val()); |
808 |
var value = parseInt($(this).val()); |
Lines 811-819
Link Here
|
811 |
row.insertAfter(after); |
816 |
row.insertAfter(after); |
812 |
} |
817 |
} |
813 |
|
818 |
|
814 |
var next_priority = 1; |
819 |
var next_priority = 0; |
815 |
row.parent().find("select[name=rank-request]").each(function () { |
820 |
row.parent().find("select[name=rank-request]").each(function () { |
816 |
$(this).val(next_priority); |
821 |
$(this).val(priorities[next_priority]); |
817 |
next_priority++; |
822 |
next_priority++; |
818 |
}); |
823 |
}); |
819 |
}); |
824 |
}); |
820 |
- |
|
|