Skip to content

Commit

Permalink
fix for #335 - multilingual support: jump_to box doesn't work as expe…
Browse files Browse the repository at this point in the history
…cted
  • Loading branch information
mdorf committed Nov 12, 2024
1 parent a8753d9 commit 4b879d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/assets/javascripts/bp_visualize.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
jQuery(document).trigger("visualize_tab_change", [{tabType: tabId}]);
}

function isNotEmpty(arr) {
return Array.isArray(arr) && arr.length > 0;
function isMultiple(arr) {
return Array.isArray(arr) && arr.length > 1;
}

// Only show BioMixer when tab is clicked
Expand All @@ -105,7 +105,8 @@
objecttypes: 'class'
};

if (isNotEmpty(jQuery(document).data().bp.ont_viewer.submission_lang)) {
// if submission_lang.length == 1, don't set the language
if (isMultiple(jQuery(document).data().bp.ont_viewer.submission_lang)) {
extraParams["lang"] = jQuery(document).data().bp.ont_viewer.lang;
}

Expand Down

0 comments on commit 4b879d4

Please sign in to comment.