瀏覽代碼

add remove description element and data function

weichen 4 年之前
父節點
當前提交
fe3ccd60cf
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      backstage/static/js/utils.js

+ 11 - 0
backstage/static/js/utils.js

@@ -13,3 +13,14 @@ function removeImgData(blockArray, blockIndex, dataIndex, contentUrl) {
   axios.delete(`${PORTAL_SERVER}delete/img?url=${contentUrl}&filename=${filename}`)
   return blockArray;
 }
+
+function removeDescElement(p, textArea, inputButton, removeButton) {
+  p.remove();
+  textArea.remove();
+  inputButton.remove();
+  removeButton.remove();
+}
+
+function removeDescData(blockArray, blockIndex, dataIndex) {
+  blockArray[blockIndex].data.splice(dataIndex, 1);
+}