Bug 40517: (QA follow-up): Fix 'group selected' button active with just 1 hold selected
This fixes the following bug: 1) Select 1 hold, notice the 'group selected' button is still disabled 2) Select a 2nd hold, notice the 'group selected' button becomes enabled 3) Unselect one of the holds, notice the 'group select' is kept enabled (this is wrong, it should become disabled) Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
0a0ba6fea0
commit
90206ab4da
|
|
@ -807,17 +807,18 @@ $(document).ready(function () {
|
|||
$(".holds_table .select_hold:checked").length
|
||||
);
|
||||
if (patron_page) {
|
||||
if ($(".holds_table .select_hold:checked").length == 0) {
|
||||
$(".cancel_selected_holds").prop("disabled", true);
|
||||
$(".suspend_selected_holds").prop("disabled", true);
|
||||
$(".group_selected_holds").prop("disabled", true);
|
||||
} else {
|
||||
if ($(".holds_table .select_hold:checked").length >= 2) {
|
||||
$(".group_selected_holds").prop("disabled", false);
|
||||
}
|
||||
$(".suspend_selected_holds").prop("disabled", false);
|
||||
$(".cancel_selected_holds").prop("disabled", false);
|
||||
}
|
||||
var selectedHolds = $(".holds_table .select_hold:checked");
|
||||
var hasSelectedHolds = selectedHolds.length > 0;
|
||||
var hasMultipleSelectedHolds = selectedHolds.length >= 2;
|
||||
|
||||
$(".cancel_selected_holds, .suspend_selected_holds").prop(
|
||||
"disabled",
|
||||
!hasSelectedHolds
|
||||
);
|
||||
$(".group_selected_holds").prop(
|
||||
"disabled",
|
||||
!hasMultipleSelectedHolds
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue