use javascript variable for repo_primary_branch

This commit is contained in:
Bryce Larson 2019-10-28 11:32:09 -06:00
parent bd3b708a27
commit 8e79a8df27
No known key found for this signature in database
GPG key ID: 131C38B0F02DB4CA
2 changed files with 3 additions and 2 deletions

View file

@ -52,7 +52,8 @@
SEARCH_CX: '{{ search_cx }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: '{{ has_source|lower }}'
HAS_SOURCE: '{{ has_source|lower }}',
REPO_PRIMARY_BRANCH_TAB_NAME: '{{ repo_primary_branch | capitalize }}'
};
</script>
{%- for scriptfile in script_files %}

View file

@ -125,7 +125,7 @@ $( document ).ready(function() {
window.location.href = window.location.href.replace($currentVer.attr("href"), clickedVer);
}
else {
if ($currentVer.text().indexOf("{{ repo_primary_branch | capitalize }}") == -1) {
if ($currentVer.text().indexOf(DOCUMENTATION_OPTIONS.REPO_PRIMARY_BRANCH_TAB_NAME) == -1) {
window.location.href = clickedVer + "topics/releases/" + $currentVer.text().trim() + ".html";
}
else window.location.href = clickedVer + "topics/releases/";