Bug 25251: Remove alert from disabled buttons

This patch removes the alert, but adds a stopPropagation call
in order to not close the menu when the disabled buttons are clicked

To test:
1 - Find a record with items in the staff interface
2 - Click edit
3 - Note 'Edit items in a batch, 'Delete items in a batch', and 'Delete
    all items' are grayed out
4 - Note hovering displays a note that there are no items
5 - Click on each anyway, an alert is generated, menu is closed
6 - Apply patch
7 - Reload page
8 - Click on each disabled option and confirm
    - there is no more alert
    - the menu does not close
9 - Confirm tooltip is displayed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2022-03-14 17:05:56 +00:00 committed by Fridolin Somers
parent e8241182ba
commit 41a5747b16

View file

@ -124,8 +124,7 @@ $(document).ready(function() {
$("#deletebiblio").tooltip();
$("#batchedit-disabled,#batchdelete-disabled,#deleteallitems-disabled")
.on("click",function(e){
e.preventDefault();
alertNoItems();
e.stopPropagation();
})
.tooltip();