diff --git a/document_root/javascript/courses/public-view/search.js b/document_root/javascript/courses/public-view/search.js index 587d47cc8903498c53905e22990f724d0ec4a167..355894c098b3a070ca21d587d9289330e71f805b 100644 --- a/document_root/javascript/courses/public-view/search.js +++ b/document_root/javascript/courses/public-view/search.js @@ -9,8 +9,10 @@ function onLoadPublicViewSearch() document.getElementById('department').onchange = handleChangeSelectHierarchy; handleChangeSelectHierarchy(); - document.getElementById('printButton').onclick = function() { - window.print(); + if (document.getElementById('printButton')) { + document.getElementById('printButton').onclick = function() { + window.print(); + }; } } @@ -59,7 +61,7 @@ function handleChangeSelectHierarchy() optGroups = subjectSelect.getElementsByTagName('optgroup'); for (var i = optGroups.length - 1; i >= 0; i--) { - if (selectedDepartments.inArray(optGroups[i].label) || collegeSelect.value == 0) { + if (selectedDepartments.inArray(optGroups[i].label)) { optGroups[i].style.display = '' } else { optGroups[i].style.display = 'none';