Add missing length property
This commit is contained in:
parent
4ed03ac5f3
commit
0abfcafd41
|
|
@ -150,14 +150,14 @@ const componentClass = computed(() => {
|
|||
});
|
||||
|
||||
const childElements = computed(() => {
|
||||
if (props.component.type === 'assignment') {
|
||||
// we don't need the childElements for an assignment component for now
|
||||
return [];
|
||||
}
|
||||
if (contentComponentDiv.value) {
|
||||
// todo: this is almost the same as the one in Assignment.vue, refactor and make one function
|
||||
let highlightParentSelector;
|
||||
if (props.component.type === 'assignment') {
|
||||
highlightParentSelector = '.assignment-text';
|
||||
} else {
|
||||
highlightParentSelector = '.content-component__content';
|
||||
}
|
||||
highlightParentSelector = '.content-component__content';
|
||||
const parent = contentComponentDiv.value.querySelector(highlightParentSelector);
|
||||
if (!parent) {
|
||||
console.warn('Parent does not exist, this should not be possible');
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ const feedbackText = computed(() => {
|
|||
const containsParagraphs = (str: string) => {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(str, 'text/html');
|
||||
return doc.querySelectorAll('p') > 0;
|
||||
return doc.querySelectorAll('p').length > 0;
|
||||
};
|
||||
const assignmentHtml = computed(() => {
|
||||
const assignmentText = assignment.value.assignment;
|
||||
|
|
|
|||
Loading…
Reference in New Issue