Bugzilla – Attachment 12402 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.34 KB, created by
Marc Véron
on 2012-09-20 18:35:40 UTC
(
hide
)
Description:
Bug 8600 - Remove search terms in advanced search
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2012-09-20 18:35:40 UTC
Size:
2.34 KB
patch
obsolete
>From 4beccc8846247934fbbebac99666f26dc0ce551b Mon Sep 17 00:00:00 2001 >From: Marc Veron <veron@veron.ch> >Date: Thu, 20 Sep 2012 20:02:19 +0200 >Subject: [PATCH] Bug 8600 - Remove search terms in advanced search >Content-Type: text/plain; charset="utf-8" > >Enhanced version with better handling of [+] and [-] buttons. >[+] adds new fields aftert current line >[-] removes current line >[-] is not visible if only one line left > >Marc >--- > .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 22 ++++++++++++++----- > 1 files changed, 16 insertions(+), 6 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 cca5d0d..629cf18 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >@@ -109,7 +109,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 href="JavaScript:;" class="ButtonPlus" name="ButtonPlus" title="Add another field" onclick="add_field(this)">[+]</a> >+ <a href="JavaScript:;" class="ButtonLess" title="Remove field" onclick="remove_field(this)">[-]</a> >+ [% END %] > [% END %] > </p> > [% END %] >@@ -315,11 +318,18 @@ > <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); >+ function add_field(button) { >+ $('.ButtonLess').show(); >+ var $thisLine = $(button).parent(); >+ var $newLine = $(button).parent().clone(); >+ $thisLine.after($newLine); >+ } >+ >+ function remove_field(button) { >+ if($(button).parent().siblings().length <= 3 ) { >+ $('.ButtonLess').hide(); >+ } >+ $(button).parent().remove(); > } > </script> > >-- >1.7.2.5
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