Ver código fonte

fix description overwrite issue

weichen 4 anos atrás
pai
commit
286620362b
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      backstage/static/js/parsers.js

+ 2 - 0
backstage/static/js/parsers.js

@@ -49,6 +49,7 @@ function parseMd(content) {
         h.textContent = title;
       }
       descButton.onclick = function() {
+        blockArray[preBlockindex].data.length = blockArray[preBlockindex].data.length + 1
         const ownDataIndex = blockArray[preBlockindex].data.length;
         const {p, descTextArea, descInputButton} = getdescElements(blockDiv);
         descInputButton.onclick = function() {
@@ -56,6 +57,7 @@ function parseMd(content) {
         }
       }
       imgButton.onclick = function() {
+        blockArray[preBlockindex].data.length = blockArray[preBlockindex].data.length + 1
         const imgDataIndex = blockArray[preBlockindex].data.length;
         const {img, imgInput, widthInput, heightInput, imgInputButton, imgRemoveButton} = getImgElements(blockDiv);
         imgInputButton.onclick = function() {