Update DocsSpace.js

This commit is contained in:
Luis Fernando Molina committed 2020-12-21 11:32:58 +01:00
1 parent a68ebdbe02
commit fdde809a10
1 file changed
+19 -17
@@ -517,7 +517,6 @@ function newSuperalgosDocSpace() {
*/
if (paragraphNode.id.indexOf('definition-') >= 0) {
if (paragraphNode.id.indexOf('-summary') >= 0) {
/* For Topics we render the definition as a summary */
selectedParagraphData = paragraphNode.innerText.substring(9, paragraphNode.innerText.length)
} else {
selectedParagraphData = paragraphNode.innerText
@@ -1170,7 +1169,7 @@ function newSuperalgosDocSpace() {
/* We start with the Definition Table / Summary */
if (schemaDocument.definition !== undefined) {
if (objectBeingRendered.category === 'Topic') {
if (objectBeingRendered.category === 'Topic' || objectBeingRendered.category === 'Concept') {
HTML = HTML + '<div id="definition-summary-editable-paragraph" class="docs-summary"><b>Summary:</b> ' + addToolTips(schemaDocument.definition) + '</div>'
} else {
HTML = HTML + '<table class="docs-definition-table">'
@@ -1188,23 +1187,10 @@ function newSuperalgosDocSpace() {
}
}
HTML = HTML + '<div id="docs-content">'
let paragraphIndex = 0
if (schemaDocument.paragraphs !== undefined) {
for (let i = 0; i < schemaDocument.paragraphs.length; i++) {
let key = 'editable-paragraph-' + paragraphIndex
let paragraph = schemaDocument.paragraphs[i]
renderParagraph(paragraph, key)
paragraphIndex++
}
}
if (objectBeingRendered.category === 'Node') {
autoGeneratedHtml()
}
HTML = HTML + '</div>' // Content Ends
HTML = HTML + '</div>' // Clickeable Container Ends
addContent()
HTML = HTML + '</div>' // Clickeable Container Ends
/*
Here we inject the HTML we built into the DOM at the Docs Space Div.
*/
@@ -1220,6 +1206,22 @@ function newSuperalgosDocSpace() {
*/
addImages()
function addContent() {
HTML = HTML + '<div id="docs-content">'
if (schemaDocument.paragraphs !== undefined) {
for (let i = 0; i < schemaDocument.paragraphs.length; i++) {
let key = 'editable-paragraph-' + paragraphIndex
let paragraph = schemaDocument.paragraphs[i]
renderParagraph(paragraph, key)
paragraphIndex++
}
}
if (objectBeingRendered.category === 'Node') {
autoGeneratedHtml()
}
HTML = HTML + '</div>' // Content Ends
}
function addImages() {
addProjectImage()
if (schemaDocument.definition !== undefined) {