Pārlūkot izejas kodu

add remove description element and data function

weichen 4 gadi atpakaļ
vecāks
revīzija
fe3ccd60cf
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  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);
+}