From 6b12857de2ee915b8d4cf1ef78e212ed9e1d53b1 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 9 Dec 2014 13:00:02 -0500 Subject: [PATCH] Bug 7741 [Follow-up] Clear search terms in Z3950 search page This patch makes a follow-up change and takes as its basis a dependency on Bug 13218 - usability enhancement for z39.50 search. If we have a one-column search form it's possible to put the "Clear search form" link at the bottom of the form rather than in the header, logically associating it with the grouping of form fields which will be affected. Doing so also allows us to eliminate all the custom styling which was an issue for QA. Other changes made by this patch: Fixing the indentation error, correcting the case of the link text ("Clear search form" instead of "Clear Search Form"), and adding "preventDefault()" to the click handler so that clicking the link doesn't scroll the user back to the top of the page. To test, apply the previous patch and this one on top of Bug 13218. Repeat the test plan. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/acqui/z3950_search.tt | 6 ++++-- .../prog/en/modules/cataloguing/z3950_auth_search.tt | 10 ++++++---- .../prog/en/modules/cataloguing/z3950_search.tt | 6 ++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt index 92b1f866b6..9b89e91892 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt @@ -32,7 +32,8 @@ $(".linktools").hide(); $("tr").removeClass("selected"); }); - $("#resetZ3950Search").click(function() { + $("#resetZ3950Search").click(function(e) { + e.preventDefault(); $("form[name='f']").find("input[type=text]").val(""); }); @@ -89,7 +90,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
[% IF ( opsearch ) %] -

Order from external source Clear Search Form

+

Order from external source

@@ -117,6 +118,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : +

Clear search form

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt index 187857847c..70d2b26d7f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt @@ -58,9 +58,10 @@ $(document).ready(function(){ } else return true; }); - $("#resetZ3950Search").click(function() { - $("form[name='f']").find("input[type=text]").val(""); - }); + $("#resetZ3950Search").click(function(e) { + e.preventDefault(); + $("form[name='f']").find("input[type=text]").val(""); + }); }); [% IF ( total_pages ) %] @@ -103,7 +104,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %]
[% IF ( opsearch ) %] -

Z39.50 Authority search pointsClear Search Form

+

Z39.50 Authority search points

@@ -128,6 +129,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
  • +

    Clear search form

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt index cc16e9a24f..79e8015122 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt @@ -59,7 +59,8 @@ $(document).ready(function(){ } else return true; }); - $("#resetZ3950Search").click(function() { + $("#resetZ3950Search").click(function(e) { + e.preventDefault(); $("form[name='f']").find("input[type=text]").val(""); }); }); @@ -104,7 +105,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %]
    [% IF ( opsearch ) %] -

    Z39.50/SRU search Clear Search Form

    +

    Z39.50/SRU search

    @@ -122,6 +123,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
  • +

    Clear search form

    -- 2.39.5