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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (-3 lines)
Lines 85-90 Link Here
85
        });
85
        });
86
    </script>
86
    </script>
87
[% END %]
87
[% END %]
88
89
<!-- For keeping the text when navigating the search tabs -->
90
[% INCLUDE 'searchbox-keep-text.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/searchbox-keep-text.inc (-30 lines)
Lines 1-30 Link Here
1
<script type="text/javascript">
2
//<![CDATA[
3
function keep_text(clicked_index) {
4
    var searchboxes = document.getElementsByClassName("head-searchbox");
5
    var persist = searchboxes[0].value;
6
7
    for (i = 0; i < searchboxes.length - 1; i++) {
8
        if (searchboxes[i].value != searchboxes[i+1].value) {
9
            if (i === searchboxes.length-2) {
10
                if (searchboxes[i].value != searchboxes[0].value) {
11
                    persist = searchboxes[i].value;
12
                } else if (searchboxes.length === 2) {
13
                    if (clicked_index === 0) {
14
                        persist = searchboxes[1].value;
15
                    }
16
                } else {
17
                    persist = searchboxes[i+1].value;
18
                }
19
            } else if (searchboxes[i+1].value != searchboxes[i+2].value) {
20
                persist = searchboxes[i+1].value;
21
            }
22
        }
23
    }
24
25
    for (i = 0; i < searchboxes.length; i++) {
26
        searchboxes[i].value = persist;
27
    }
28
}
29
//]]>
30
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js (-1 / +28 lines)
Lines 129-131 function playSound( sound ) { Link Here
129
    }
129
    }
130
    document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';
130
    document.getElementById("audio-alert").innerHTML = '<audio src="' + sound + '" autoplay="autoplay" autobuffer="autobuffer"></audio>';
131
}
131
}
132
- 
132
133
// For keeping the text when navigating the search tabs
134
function keep_text(clicked_index) {
135
    var searchboxes = document.getElementsByClassName("head-searchbox");
136
    var persist = searchboxes[0].value;
137
138
    for (i = 0; i < searchboxes.length - 1; i++) {
139
        if (searchboxes[i].value != searchboxes[i+1].value) {
140
            if (i === searchboxes.length-2) {
141
                if (searchboxes[i].value != searchboxes[0].value) {
142
                    persist = searchboxes[i].value;
143
                } else if (searchboxes.length === 2) {
144
                    if (clicked_index === 0) {
145
                        persist = searchboxes[1].value;
146
                    }
147
                } else {
148
                    persist = searchboxes[i+1].value;
149
                }
150
            } else if (searchboxes[i+1].value != searchboxes[i+2].value) {
151
                persist = searchboxes[i+1].value;
152
            }
153
        }
154
    }
155
156
    for (i = 0; i < searchboxes.length; i++) {
157
        searchboxes[i].value = persist;
158
    }
159
}

Return to bug 15910