|
@@ -51,10 +51,14 @@ function parseMd(content) {
|
|
|
descButton.onclick = function() {
|
|
|
blockArray[preBlockindex].data.length = blockArray[preBlockindex].data.length + 1
|
|
|
const ownDataIndex = blockArray[preBlockindex].data.length;
|
|
|
- const {p, descTextArea, descInputButton} = getdescElements(blockDiv);
|
|
|
+ const {p, descTextArea, descInputButton, descRemoveButton} = getdescElements(blockDiv);
|
|
|
descInputButton.onclick = function() {
|
|
|
blockArray = handleDescInputClick(p, descTextArea.value, blockArray, preBlockindex, ownDataIndex);
|
|
|
}
|
|
|
+ descRemoveButton.onclick = function() {
|
|
|
+ removeDescElement(p, descTextArea, descInputButton, descRemoveButton);
|
|
|
+ removeDescData(blockArray, preBlockindex, ownDataIndex);
|
|
|
+ }
|
|
|
}
|
|
|
imgButton.onclick = function() {
|
|
|
blockArray[preBlockindex].data.length = blockArray[preBlockindex].data.length + 1
|
|
@@ -106,13 +110,17 @@ function parseMd(content) {
|
|
|
const preBlockindex = blockCount;
|
|
|
const ownDataIndex = preDataIndex;
|
|
|
preDataIndex += 1;
|
|
|
- const {p, descTextArea, descInputButton} = getdescElements(parseBlockDiv);
|
|
|
+ const {p, descTextArea, descInputButton, descRemoveButton} = getdescElements(parseBlockDiv);
|
|
|
const text = line;
|
|
|
p.textContent = text;
|
|
|
blockArray = addDataToBlockArray({description: {text: text}}, blockArray, preBlockindex, ownDataIndex);
|
|
|
descInputButton.onclick = function() {
|
|
|
blockArray = handleDescInputClick(p, descTextArea.value, blockArray, preBlockindex, ownDataIndex);
|
|
|
}
|
|
|
+ descRemoveButton.onclick = function() {
|
|
|
+ removeDescElement(p, descTextArea, descInputButton, descRemoveButton);
|
|
|
+ removeDescData(blockArray, preBlockindex, ownDataIndex);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return {frontMatters: frontMatters, blockArray: blockArray, blockCount: blockCount}
|