Bug 39957: Fix JS error on credit and debit types administration pages
This patch fixes an JS error in several administration pages, introduced by Bug 39099 and 39810. We can't access a DOM node without checking for its existence first. To test, apply the patch and go to Administration. - Check the following pages: - Authorized values - Credit types - Debit types - Item types - Patron categories. - On each page check the JavaScript console on the initial page. There should be no errors. - Check the add/edit page for each and confirm that the library limitation Select2 widget works correctly. Sponsored-by: Athens County Public Libraries Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
d7af2cacff
commit
fdf3b4e799
|
|
@ -439,8 +439,11 @@
|
|||
}
|
||||
return true;
|
||||
});
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
|
||||
if ($("#library_limitation").length > 0) {
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -289,8 +289,10 @@
|
|||
//Start filtered
|
||||
$("#filter_system").click();
|
||||
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
if ($("#library_limitation").length > 0) {
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -306,8 +306,10 @@
|
|||
//Start filtered
|
||||
$("#filter_system").click();
|
||||
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
if ($("#library_limitation").length > 0) {
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -567,8 +567,11 @@
|
|||
if( $("#icons .tab-pane.active").length < 1 ){
|
||||
$("#icons a:first").tab("show");
|
||||
}
|
||||
$("#library_limitation")[0].style.minWidth = '450px';
|
||||
$("#library_limitation").select2();
|
||||
|
||||
if ($("#library_limitation").length > 0) {
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -52,8 +52,10 @@ $(document).ready(function () {
|
|||
table_settings
|
||||
);
|
||||
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
if ($("#library_limitation").length > 0) {
|
||||
$("#library_limitation")[0].style.minWidth = "450px";
|
||||
$("#library_limitation").select2();
|
||||
}
|
||||
|
||||
$("#categorycode").on("blur", function () {
|
||||
toUC(this);
|
||||
|
|
|
|||
Loading…
Reference in New Issue