The keep_text function in koha-tmpl/intranet-tmpl/prog/js/staff-global.js is functional but not very readable. We can simplify it.
Created attachment 108567 [details] [review] Bug 26248: Simplify keep_text function used in header search The current code is functional but not very readable. This patch simplifies the code to be more readable and to be more efficient. To test: 1) Apply patch 2) Refresh browser cache 3) Type "A" in "Check out" tab 4) Click "Check in" (and other tabs) 5) Observe that text is persisted from original tab 6) Type "B" in "Search the catalog" tab 7) Click "Renew" tab 8) Observe that text is persisted from latest changed tab
Hmm working fine on mainpage.pl but having an issue clicking on "Search the catalog" on search.pl...
For some reason that tab is passing an index value of 4 rather than 3...
Ahh the keep_text isn't set correctly in "koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc"
Adding dependency on Bug 26249
Created attachment 108959 [details] Example pendings on last-borrower As per comment #3
Comment on attachment 108959 [details] Example pendings on last-borrower Sorry wrong bug!!!
Created attachment 115262 [details] [review] Bug 26248: Simplify keep_text function used in header search The current code is functional but not very readable. This patch simplifies the code to be more readable and to be more efficient. To test: 1) Apply patch 2) Refresh browser cache 3) Type "A" in "Check out" tab 4) Click "Check in" (and other tabs) 5) Observe that text is persisted from original tab 6) Type "B" in "Search the catalog" tab 7) Click "Renew" tab 8) Observe that text is persisted from latest changed tab Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com>
I believe there is still a small glitch here: When I - enter something in one tab - move to the next - empty the input field - switch tab again - the deleted string reappears
(In reply to Katrin Fischer from comment #9) > I believe there is still a small glitch here: > When I > - enter something in one tab > - move to the next > - empty the input field > - switch tab again > - the deleted string reappears Hmm weird. I thought that I'd thoroughly tested this. I probably don't have time to work on this again for a long time, but that's a useful note!
I don't recall why I cared about this in the first place...