Hi all, I'm wondering if you could help. I want to have 'Search the Catalog' selected first on the main staff client page, but the code has changed A LOT in 3.16 and my old JQuery doesn't work. Any tips on how to write this would be appreciated because my attempts have failed. Nicole
Hie, I think I have a working code. It simply simulates the user click on the tab title : $(document).ready(function(){ $("#header_search a[href='#catalog_search']").click(); }); Best regards, Le 03/06/2014 04:38, Nicole Engard a écrit :
Hi all,
I'm wondering if you could help. I want to have 'Search the Catalog' selected first on the main staff client page, but the code has changed A LOT in 3.16 and my old JQuery doesn't work. Any tips on how to write this would be appreciated because my attempts have failed.
Nicole _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- Fridolin SOMERS Biblibre - Pôles support et système fridolin.somers@biblibre.com
On Tue, Jun 3, 2014 at 12:58 AM, Fridolin SOMERS < fridolin.somers@biblibre.com> wrote:
$(document).ready(function(){ $("#header_search a[href='#catalog_search']").click(); });
That works on every page in the staff client, but if I wanted it to work on the main page only so I edited it like this: $(document).ready(function(){ if (window.location.href.indexOf("cgi-bin/koha/mainpage.pl") > -1) { $("#header_search a[href='#catalog_search']").click(); } }); And it's perfect!!! Thanks Fridolin!
Much faster and simple : each page (intranet and opac) has an id on the body : For example for mainpage : $(document).ready(function(){ $("body#main_intranet-main #header_search a[href='#catalog_search']").click(); }); Le 03/06/2014 15:19, Nicole Engard a écrit :
On Tue, Jun 3, 2014 at 12:58 AM, Fridolin SOMERS < fridolin.somers@biblibre.com> wrote:
$(document).ready(function(){ $("#header_search a[href='#catalog_search']").click(); });
That works on every page in the staff client, but if I wanted it to work on the main page only so I edited it like this:
$(document).ready(function(){ if (window.location.href.indexOf("cgi-bin/koha/mainpage.pl") > -1) { $("#header_search a[href='#catalog_search']").click(); }
});
And it's perfect!!! Thanks Fridolin!
-- Fridolin SOMERS Biblibre - Pôles support et système fridolin.somers@biblibre.com
participants (2)
-
Fridolin SOMERS -
Nicole Engard