Use same style for single and multiple errors in populateCard
This commit is contained in:
@ -471,13 +471,10 @@ var CodeOceanEditor = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// one or more errors?
|
|
||||||
if (errorMessagesToShow.length > 1) {
|
|
||||||
// delete all current elements
|
// delete all current elements
|
||||||
targetNode.text('');
|
targetNode.text('');
|
||||||
// create a new list and append each element
|
// create a new list and append each element
|
||||||
const ul = document.createElement("ul");
|
const ul = document.createElement("ul");
|
||||||
ul.setAttribute('class', 'error_messages_list');
|
|
||||||
|
|
||||||
// Extract detailed linter results
|
// Extract detailed linter results
|
||||||
if (result.file_role === 'teacher_defined_linter') {
|
if (result.file_role === 'teacher_defined_linter') {
|
||||||
@ -527,10 +524,14 @@ var CodeOceanEditor = {
|
|||||||
ul.append(li);
|
ul.append(li);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
targetNode.append(ul);
|
|
||||||
|
// one or more errors?
|
||||||
|
if (errorMessagesToShow.length > 1) {
|
||||||
|
ul.setAttribute('class', 'error_messages_list');
|
||||||
} else {
|
} else {
|
||||||
targetNode.html(errorMessagesToShow.join(''));
|
ul.setAttribute('class', 'single_error_message');
|
||||||
}
|
}
|
||||||
|
targetNode.append(ul);
|
||||||
}
|
}
|
||||||
//card.find('.row .col-sm-9').eq(4).find('a').attr('href', '#output-' + index);
|
//card.find('.row .col-sm-9').eq(4).find('a').attr('href', '#output-' + index);
|
||||||
},
|
},
|
||||||
|
@ -157,6 +157,11 @@ button i.fa-spin {
|
|||||||
padding-inline-start: 1.25rem;
|
padding-inline-start: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.single_error_message {
|
||||||
|
list-style-type: none;
|
||||||
|
padding-inline-start: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.enforce-top-margin {
|
.enforce-top-margin {
|
||||||
margin-top: 5px !important;
|
margin-top: 5px !important;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user