Bug 28847: Only apply JS to branch/multibranch selection if there are search groups
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
065ec4e726
commit
109bbcf242
1 changed files with 17 additions and 15 deletions
|
@ -455,23 +455,25 @@
|
|||
[% Asset.js("lib/jquery/plugins/jquery.deserialize.min.js") | $raw %]
|
||||
[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
|
||||
<script>
|
||||
function branch_limit() {
|
||||
if( $("#branchloop").val() != "" ){
|
||||
$("#categoryloop").val("").prop('disabled',true);
|
||||
} else {
|
||||
$("#categoryloop").prop('disabled',false);
|
||||
}
|
||||
if ( $("#categoryloop").val() != "" ){
|
||||
$("#branchloop").val("").prop('disabled',true);
|
||||
} else {
|
||||
$("#branchloop").prop('disabled',false);
|
||||
}
|
||||
}
|
||||
$(document).ready(function() {
|
||||
branch_limit();
|
||||
$("#branchloop,#categoryloop").on("change",function(){
|
||||
[% IF search_groups %]
|
||||
function branch_limit() {
|
||||
if( $("#branchloop").val() != "" ){
|
||||
$("#categoryloop").val("").prop('disabled',true);
|
||||
} else {
|
||||
$("#categoryloop").prop('disabled',false);
|
||||
}
|
||||
if ( $("#categoryloop").val() != "" ){
|
||||
$("#branchloop").val("").prop('disabled',true);
|
||||
} else {
|
||||
$("#branchloop").prop('disabled',false);
|
||||
}
|
||||
}
|
||||
branch_limit();
|
||||
});
|
||||
$("#branchloop,#categoryloop").on("change",function(){
|
||||
branch_limit();
|
||||
});
|
||||
[% END %]
|
||||
|
||||
$('#advsearches').tabs();
|
||||
jQuery.cookie.json = true;
|
||||
|
|
Loading…
Reference in a new issue