* [misc] support for replacing zentaolist with helper 'insertZentaoList'.

This commit is contained in:
sunhao
2025-02-05 14:24:46 +08:00
committed by 代婷婷
parent 236163ff2a
commit e2455dfd53
+2 -11
View File
@@ -73,18 +73,9 @@ window.replaceZentaoList = function(oldBlockID, newType, newblockID, props)
};
/* 插入禅道列表。*/
window.insertZentaoList = function(type, blockID, props, tryUpdateBlockID)
window.insertZentaoList = function(type, blockID, props, replaceBlockID)
{
if(tryUpdateBlockID)
{
const replaceID = typeof tryUpdateBlockID === 'number' ? tryUpdateBlockID : blockID;
const $block = $('#docApp').find(`.zentao-list[data-id="${replaceID}"]`);
if($block.length)
{
reloadZentaoList(blockID);
return;
}
}
if(replaceBlockID) return replaceZentaoList(replaceBlockID, type, blockID, props);
getDocApp().editor.$.insertCustom(getZentaoListProps(type, blockID, props));
};