Skip to content

Commit

Permalink
Fixed the ever-reloading-circle on firefox of the main page.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheItCrOw committed Jan 14, 2025
1 parent c0a9f43 commit 10132f6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions uce.portal/resources/templates/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,15 @@ $('body').on('click', '.view .search-btn', function (event) {
* Fires whenever a new corpus is selected. We update some UI components then
*/
$('body').on('change', '#corpus-select', function () {
const selectedOption = $(this).get(0).options[$(this).get(0).selectedIndex];
handleCorpusSelectionChanged($(this));
})

/**
* We need to hide and display different ui elements according to the corpus selected.
* @param $select
*/
function handleCorpusSelectionChanged($select){
const selectedOption = $select.get(0).options[$select.get(0).selectedIndex];
const hasSr = selectedOption.getAttribute("data-hassr");
const hasBiofidOnthology = selectedOption.getAttribute("data-hasbiofid");
const sparqlAlive = selectedOption.getAttribute("data-sparqlalive");
Expand All @@ -84,7 +92,7 @@ $('body').on('change', '#corpus-select', function () {
else $('.ragbot-chat-include').hide();

updateSearchHistoryUI();
})
}

/**
* Triggers whenever an open-corpus inspector button is clicked.
Expand Down Expand Up @@ -183,7 +191,7 @@ function activatePopovers() {
* We have some UI components that need to be refreshed when the corpus is loaded.
*/
function reloadCorpusComponents() {
$('#corpus-select').change();
handleCorpusSelectionChanged($('#corpus-select'));
}

$(document).ready(function () {
Expand Down

0 comments on commit 10132f6

Please sign in to comment.