[Koha-devel] [Koha] 3.8.4 staff main page

Paul paul.a at aandc.org
Mon Sep 17 18:22:10 CEST 2012


At 12:14 PM 9/17/2012 +0200, Robin Sheat wrote:
>Op 15-09-12 18:51, Paul schreef:
> > I am unaware of an *easy* way to write anything in js to accomplish my
> > staff's request.  However, here's the fix (Mark, if you think this could
> > be of use to the community as you suggest above, please disseminate it
> > as an enhancement, bug, whatever ...) which was remarkably easy, once I
> > found the relevant code. FYI, Firebug does not appear to be of much use
> > tracking down things like these.
>
>Mark is right, your fix is a bad idea. Here is how to do it properly.

Robin - tnx for taking the time to reply.

What value of "bad"? A simple, fully functional, easy, reversible, move 
(not rewrite) of a single line of code, is bad?

>1) using firebug, determine the ID of the tabs bit, it turns out to be
>header_search.

By grepping header_search was how I eventually got to home_search.inc in 
the first place to modify the order of lines 32-35.

>2) look up what this jquery ui-tabs thing is, which will take you to:
>http://jqueryui.com/demos/tabs/
>3) poke around and see that the 'selected' option looks like the kind of
>thing that we might want.
>3.5) play around with this in the firebug console to make sure we have
>everything right.
>4) write the following JS into the intranetuserjs box:
>$(function() {
>$('#header_search').tabs({selected:2});
>});

This does not appear to function - the focus remains fixed on the first tab 
- despite trying a copy/paste of your suggestion, and various combinations of:

         $('#header_search').tabs({selected:#catalog_search});
         $('#header_search').tabs('select', '#catalog_search');

with and without single quotes and|or hash marks.

I also tried, from the <http://jqueryui.com/demos/tabs/> you suggested (and 
which I had already visited):

         var $tabs = $('#header_search').tabs({
                 add: function(event, ui) {
                         $tabs.tabs('select', '#catalog_search');
                 }
         });

Still no joy, except by re-ordering lines 32-35 in home_search.inc

>5) go have a beer because that was pretty quick :)

Probably not -- and I'm pretty close to being teetotal; last time I had a 
glass of anything alcoholic was champagne at my wedding in 1963.

>5.5) apologise to firebug because it was pretty useful after all,

Thank you Firebug, with my apologies for taking your name in vain ...

>then
>consider that perhaps you had too many beers, and talking to bits of
>software is rarely constructive. Put your phone away so you don't
>drunk-dial someone.

Now that's a bit melodramatic, don't you think?

Paul



More information about the Koha-devel mailing list