Skip to content

Commit

Permalink
correct display of tab classes on the reviewer page #1247
Browse files Browse the repository at this point in the history
  • Loading branch information
user committed Jun 28, 2023
1 parent 0fabbe3 commit 798ab36
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions dataedit/static/peer_review/opr_reviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,15 +722,15 @@ const otherTabs = [
];
const reviewContent = document.querySelector(".review__content");
function updateTabClasses() {
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor', 'resource']; // список имен вкладок
const tabNames = ['general', 'spatiotemporal', 'source', 'license', 'contributor', 'resource'];
for (let i = 0; i < tabNames.length; i++) {
let tabName = tabNames[i];
let tab = document.getElementById(tabName + '-tab');
if (!tab) continue; // пропускаем, если вкладка не найдена
if (!tab) continue;

let fields = Array.from(document.querySelectorAll('#' + tabName + ' .field')); // извлекаем поля для данной вкладки
let fields = Array.from(document.querySelectorAll('#' + tabName + ' .field'));

let allOk = true; // предполагаем, что все поля в порядке
let allOk = true;
for (let j = 0; j < fields.length; j++) {
let fieldState = getFieldState(fields[j].id.replace('field_', ''));
if (fieldState !== 'ok') {
Expand All @@ -742,8 +742,7 @@ function updateTabClasses() {
tab.classList.add('status');
tab.classList.add('status--done');
} else {
tab.classList.remove('status');
tab.classList.remove('status--done');
tab.classList.add('status');
}
}
}
Expand Down

0 comments on commit 798ab36

Please sign in to comment.