Koha Team Lyon3 proposal/patch: When accessing a detail page after a search, it would be useful to have the focus on the search box.
Created attachment 10008 [details] [review] proposed patch
TEST PLAN : In staff interface, search for a biblio, then access its detail page. Once the page is loaded the focus should be on the search box.
Created attachment 10021 [details] [review] Bug 8217:[SIGNED-OFF] Focus on search box in staff detail page Signed-off-by: Marc Veron <veron@veron.ch> Works exactly as expected. Adds onload="document.getElementById('search-form').focus() to HTMP body.
QA comment: tiny patch nothing specific to say from QA pov
This tiny ENH could be ported to 3.8 safely & would be useful I think.
It should be put in the coding guidelines that using <body onload> is not the best way to add load events to a page. Generally the event should be added to the jQuery $document(ready)() function. That lets jQuery handle all the onload events and helps prevent conflicts. I think a follow-up for this should be submitted to change this and ask that this not be pushed to 3.8.
Created attachment 10162 [details] [review] Bug 8217: Followup: move code to the document.ready function I agree with Owen. Could you test this patch and verify it do the same thing as previous please ?
Sorry, Monday morning, I have troubles with my grammar... I reformulate : "Could you test this patch and verify that it does the same thing as previous please ?"
Pushed the first patch, the follow up looks fine to me, will push that to 3.8.x when it is pushed to master
(In reply to comment #6) > It should be put in the coding guidelines that using <body onload> is not > the best way to add load events to a page. Generally the event should be > added to the jQuery $document(ready)() function. That lets jQuery handle all > the onload events and helps prevent conflicts. I think a follow-up for this > should be submitted to change this and ask that this not be pushed to 3.8. Done: http://wiki.koha-community.org/wiki/Coding_Guidelines#don.27t_use_js_in_.3Cbody_onload.3D....3E
Testing shows, that after applying the second patch, the focus is not in the search box. On current HEAD it's ok.
Created attachment 10346 [details] [review] Bug 8217: Followup: move code to the document.ready function Oups, it's my fault. This one should be correct (First patch marked as obsolete. It's already pushed)
Created attachment 10443 [details] [review] Bug 8217: Followup: move code to the document.ready function Signed-off-by: Mirko Tietgen <5p4m@gmx.de>
Followup: Passed QA
Follow-up pushed on master branch directly, does not apply on new/bug_8217
Follow up does not apply to 3.8.x <<<<<<< HEAD $('#bibliodetails > ul').tabs(); ======= $('#bibliodetails').tabs(); $('#search-form').focus(); >>>>>>> a4d2a99... Bug 8217: Followup: move code to the document.ready function Please
Created attachment 10596 [details] [review] Bug 8217: Followup: move code to the document.ready function [patch for 3.8] Hi Chris, Here is the patch for 3.8
Thanks Jonathan. Pushed to stable, will be in 3.8.3