View | Details | Raw Unified | Return to bug 8600
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt (-9 / +11 lines)
Lines 110-118 Link Here
110
[% IF ( expanded_options ) %]
110
[% IF ( expanded_options ) %]
111
        <!--   [% IF ( search_box.scan_index ) %]<input type="checkbox" name="scan" id="scan" value="1" /> Scan Indexes[% END %] -->
111
        <!--   [% IF ( search_box.scan_index ) %]<input type="checkbox" name="scan" id="scan" value="1" /> Scan Indexes[% END %] -->
112
        [% IF ( !loop.first ) %]
112
        [% IF ( !loop.first ) %]
113
            <a href="JavaScript:;" class="ButtonPlus" name="ButtonPlus" title="Add another field" onclick="add_field(this)">[+]</a>
113
            <a href="JavaScript:;" class="ButtonLess" title="Remove field" onclick="remove_field(this)">[-]</a>
114
            <a href="JavaScript:;" class="ButtonLess" title="Remove field" onclick="remove_field(this)">[-]</a>
114
        [% END %]
115
        [% END %]
115
        [% IF ( search_box.add_field ) %]<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>[% END %]
116
[% END %]
116
[% END %]
117
        </p>
117
        </p>
118
    [% END %]
118
    [% END %]
Lines 318-332 Link Here
318
<script type="text/javascript" language="javascript">
318
<script type="text/javascript" language="javascript">
319
    /* This function allows to display a new field to search.
319
    /* This function allows to display a new field to search.
320
    */
320
    */
321
    function add_field() {
321
    function add_field(button) {
322
        var ButtonPlus = document.getElementById('ButtonPlus');
322
        $('.ButtonLess').show();
323
        var line       = ButtonPlus.parentNode;
323
        var $thisLine = $(button).parent();
324
        line.parentNode.appendChild(line.cloneNode(true));
324
        var $newLine = $(button).parent().clone();
325
        line.removeChild(ButtonPlus);
325
        $thisLine.after($newLine);
326
    }
326
    }
327
327
328
    function remove_field(buttonless) {
328
    function remove_field(button) {
329
        $(buttonless).parent().remove();
329
        if($(button).parent().siblings().length <= 3 ) {
330
           $('.ButtonLess').hide(); 
331
        }
332
        $(button).parent().remove();
330
    }
333
    }
331
</script>
334
</script>
332
335
333
- 

Return to bug 8600