* [misc] support for replacing zentaolist with helper 'insertZentaoList'.
This commit is contained in:
@@ -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));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user