Created attachment 105671 [details] Screenshot of the wrong position of the menu launched by Actions button When clicking on the Actions button in the Z39.50 Search Results window, sometimes the menu is not displayed correctly (actually it is displayed under or next to the table with Results and it is not visible in the displayed area). Usually it happens after clicking on the table row and then on the Actions button.
Hi Jan, I don't see this behaviour in my 20.05/master installations. Which browser are you using? Did you make any local changes? (I notice the window is quite big on your screenshot, did you change that manually or was something changed to achieve that?)
I am able to reproduce this problem in master. I'm investigating.
Created attachment 105851 [details] [review] Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly This patch modifies, again, the way the actions popup is implemented in Z39.50 search results, whether it be in cataloging, authorities, or acquisitions. The solution for Bug 25282 changed some markup which was being referred to in JavaScript. This patch makes the markup more consistent and unifies handling of the menu in one JavaScript file. The solution changes the way a menu is generated when the user clicks within the row of Z39.50 search results (not on the "Actions" button). The script now creates a clone of the actions menu in that row and appends it to the <td> the user clicked on. To test, apply the patch and clear your browser cache if necessary. Test these three areas in the same way: 1. Cataloging -> New from Z39.50 -> Search 2. Authorities -> New from Z39.50 -> Search 3. Acquisitions -> Vendor -> Add to Basket -> From an external source -> Search. In each case, test the functionality of the "Actions" menu button in the last column ("Preview" in Acquisitions search results). The menu should be positioned correctly and menu choice works correctly Click anywhere else in the search results table. The same actions menu should be triggered in that table cell. Confirm that these menu items work correctly according to the row which was clicked. Current depends: 25282
> Current depends: 25282 Hm, I guess that doesn't actually update the "depends" field?
I don't recreate the problem on master (tested with Firefox and Chromium).
Steps to reproduce in both Firefox and Chrome: 1. In the Z39.50 results window, click the "Actions" menu button for any result to expand it. 2. Click it again to close it. 3. Click elsewhere in the table row. A menu is supposed to appear but it doesn't. 4. Click the "Actions" menu again. The menu appears off screen. https://zivotdesign.com/p/view.php?p=15923064298194 It also happens this way: 1. Click the "Actions" menu button. 2. Click anywhere in the table row without closing the actions menu first.
Sorry Owen, I did not get the "click somewhere in the row" trick. Now I recreate.
How hard would it be to display the menu close to the cursor? Did you try already?
(In reply to Jonathan Druart from comment #8) > How hard would it be to display the menu close to the cursor? Did you try > already? .·´¯`(>▂<)´¯`·. Pretty hard, it turns out, because of the way the Bootstrap menu is positioned. Maybe someone smarter than me could figure it out. The best I could do was to position the menu relative to the table cell which was clicked on.
Created attachment 105915 [details] [review] Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly This patch modifies, again, the way the actions popup is implemented in Z39.50 search results, whether it be in cataloging, authorities, or acquisitions. The solution for Bug 25282 changed some markup which was being referred to in JavaScript. This patch makes the markup more consistent and unifies handling of the menu in one JavaScript file. The solution changes the way a menu is generated when the user clicks within the row of Z39.50 search results (not on the "Actions" button). The script now creates a clone of the actions menu in that row and appends it to the <td> the user clicked on. To test, apply the patch and clear your browser cache if necessary. Test these three areas in the same way: 1. Cataloging -> New from Z39.50 -> Search 2. Authorities -> New from Z39.50 -> Search 3. Acquisitions -> Vendor -> Add to Basket -> From an external source -> Search. In each case, test the functionality of the "Actions" menu button in the last column ("Preview" in Acquisitions search results). The menu should be positioned correctly and menu choice works correctly Click anywhere else in the search results table. The same actions menu should be triggered in that table cell. Confirm that these menu items work correctly according to the row which was clicked. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Ok, works for me. I noticed bug 25773 when testing.
Created attachment 106095 [details] [review] Bug 25702: Actions button on Search results from Z39.50 is displayed incorrectly This patch modifies, again, the way the actions popup is implemented in Z39.50 search results, whether it be in cataloging, authorities, or acquisitions. The solution for Bug 25282 changed some markup which was being referred to in JavaScript. This patch makes the markup more consistent and unifies handling of the menu in one JavaScript file. The solution changes the way a menu is generated when the user clicks within the row of Z39.50 search results (not on the "Actions" button). The script now creates a clone of the actions menu in that row and appends it to the <td> the user clicked on. To test, apply the patch and clear your browser cache if necessary. Test these three areas in the same way: 1. Cataloging -> New from Z39.50 -> Search 2. Authorities -> New from Z39.50 -> Search 3. Acquisitions -> Vendor -> Add to Basket -> From an external source -> Search. In each case, test the functionality of the "Actions" menu button in the last column ("Preview" in Acquisitions search results). The menu should be positioned correctly and menu choice works correctly Click anywhere else in the search results table. The same actions menu should be triggered in that table cell. Confirm that these menu items work correctly according to the row which was clicked. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as expected, passes QA scripts.. nice bit of refactoring. Passing QA
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.01
missing dependencies, not backported to 19.11.x