Summary: | Print dropdown in members toolbar should auto close | ||
---|---|---|---|
Product: | Koha | Reporter: | Jason Robb <jrobb> |
Component: | Circulation | Assignee: | Owen Leonard <oleonard> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | chughesman, gmcharlt, kyle.m.hall, rcoert |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 39323: Print dropdown in members toolbar should auto close
Bug 39323: Print dropdown in members toolbar should auto close |
Description
Jason Robb
2025-03-13 14:32:24 UTC
This is the JS I'm using in the meantime to make the dropdown go away after an item is clicked: if (window.location.href.indexOf("borrowernumber=") > -1) { $('.dropdown-item').on('click', function() { $(this).parent().parent().removeClass('show'); }); } We are experiencing this as well. Created attachment 179729 [details] [review] Bug 39323: Print dropdown in members toolbar should auto close The upgrade to Bootstrap 5 broke some code which was designed to close a dropdown menu: $(".btn-group").removeClass("open"); This doesn't work in Bootstrap 5. You have to use: $(".dropdown-menu").removeClass("show"); However, I found that in most cases this extra code wasn't needed if we adjust the way we do the click handlers. Using "e.preventDefault()" instead of "return false" seems to be the preferred practice. This patch also makes a minor change to CSS to fix a display issue with dropdown menus. To test apply the patch and rebuild the staff interface CSS. - Clear your browser cache if necessary. - Search the catalog and click "Edit record" on one of the results. - In the basic MARC editor click the dropdown menu on the "Save" button. - Test the three options there: "Save and view record", "Save and edit items", and "Save and continue editing". - In each case clicking one of those options should result in the menu closing before the page redirects. - The main "Save" button should still work correctly. - Perform a patron search which will return results. - Check one or more patrons in the result and then click the "Add to patron list" button. The dropdown menu should look consistent with other dropdowns. - View the detail page for one of the patron in your results. - Test each of the options under the "Print" dropdown menu. In each case the menu should close itself when you click one of the menu items. - Test the "Renew patron" and "Update child to adult patron" - Click "Search to hold" and perform a catalog search which will return results. - Check one or more results and test the "Place hold" dropdown menu items. Sponsored-by: Athens County Public Libraries Created attachment 180056 [details] [review] Bug 39323: Print dropdown in members toolbar should auto close The upgrade to Bootstrap 5 broke some code which was designed to close a dropdown menu: $(".btn-group").removeClass("open"); This doesn't work in Bootstrap 5. You have to use: $(".dropdown-menu").removeClass("show"); However, I found that in most cases this extra code wasn't needed if we adjust the way we do the click handlers. Using "e.preventDefault()" instead of "return false" seems to be the preferred practice. This patch also makes a minor change to CSS to fix a display issue with dropdown menus. To test apply the patch and rebuild the staff interface CSS. - Clear your browser cache if necessary. - Search the catalog and click "Edit record" on one of the results. - In the basic MARC editor click the dropdown menu on the "Save" button. - Test the three options there: "Save and view record", "Save and edit items", and "Save and continue editing". - In each case clicking one of those options should result in the menu closing before the page redirects. - The main "Save" button should still work correctly. - Perform a patron search which will return results. - Check one or more patrons in the result and then click the "Add to patron list" button. The dropdown menu should look consistent with other dropdowns. - View the detail page for one of the patron in your results. - Test each of the options under the "Print" dropdown menu. In each case the menu should close itself when you click one of the menu items. - Test the "Renew patron" and "Update child to adult patron" - Click "Search to hold" and perform a catalog search which will return results. - Check one or more results and test the "Place hold" dropdown menu items. Sponsored-by: Athens County Public Libraries Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> |