Bugzilla – Attachment 18649 Details for
Bug 8600
Remove search terms in advanced search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8600 - Remove search terms in advanced search
Bug-8600---Remove-search-terms-in-advanced-search.patch (text/plain), 2.40 KB, created by
Chris Cormack
on 2013-06-05 01:13:50 UTC
(
hide
)
Description:
Bug 8600 - Remove search terms in advanced search
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-06-05 01:13:50 UTC
Size:
2.40 KB
patch
obsolete
>From fe0b07b8933efbc8a44bcdf316a03c17af3f3624 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9rick?= <frederick.capovilla@libeo.com> >Date: Wed, 20 Mar 2013 17:23:39 -0400 >Subject: [PATCH] Bug 8600 - Remove search terms in advanced search > >Rewrote parts of previous patch by Marc Veron to remove remove href and onclick of links and instead use jQuery > >Signed-off-by: Cedric Vita <cedric.vita@dracenie.com> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 26 ++++++++++++++------ > 1 file changed, 19 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >index 825e8be..3ef7048 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >@@ -124,7 +124,10 @@ > <input type="text" size="30" name="q" title="Enter search terms" value="" /> > [% IF ( expanded_options ) %] > <!-- [% IF ( search_box.scan_index ) %]<input type="checkbox" name="scan" id="scan" value="1" /> Scan Indexes[% END %] --> >- [% IF ( search_box.add_field ) %]<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>[% END %] >+ [% IF ( !loop.first ) %] >+ <a class="ButtonPlus" name="ButtonPlus" title="Add another field">[+]</a> >+ <a class="ButtonLess" title="Remove field">[-]</a> >+ [% END %] > [% END %] > </p> > [% END %] >@@ -335,12 +338,21 @@ > <script type="text/javascript" language="javascript"> > /* This function allows to display a new field to search. > */ >- function add_field() { >- var ButtonPlus = document.getElementById('ButtonPlus'); >- var line = ButtonPlus.parentNode; >- line.parentNode.appendChild(line.cloneNode(true)); >- line.removeChild(ButtonPlus); >- } >+ $(document).on("click", '.ButtonPlus', function() { >+ $('.ButtonLess').show(); >+ var thisLine = $(this).parent(); >+ var newLine = thisLine.clone(); >+ console.log(newLine); >+ newLine.find('input').val(''); >+ thisLine.after(newLine); >+ }); >+ >+ $(document).on("click", '.ButtonLess', function() { >+ if($(this).parent().siblings().length <= 3 ) { >+ $('.ButtonLess').hide(); >+ } >+ $(this).parent().remove(); >+ }); > </script> > > </div> >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8600
:
11454
|
12399
|
12402
|
12409
|
16560
|
16592
| 18649