* [bug#60581,done,1h] Check sub contents.

This commit is contained in:
daitingting
2025-03-17 10:07:27 +08:00
committed by 谢杞钰
parent 3f40233537
commit 8bfb5e9465
+4 -3
View File
@@ -1324,7 +1324,7 @@ const commands =
$.ajaxSubmit(
{
confirm: getLang(moduleInfo.data.isParent ? 'confirmDeleteModuleWithSub' : 'confirmDeleteModule'),
confirm: getLang(moduleInfo.modules.length > 0 || moduleInfo.docs.length > 0 ? 'confirmDeleteModuleWithSub' : 'confirmDeleteModule'),
url: $.createLink('doc', 'deleteCatalog', `moduleID=${moduleID}`),
load: false,
onSuccess: function(res)
@@ -1429,12 +1429,13 @@ const commands =
const docApp = getDocApp();
const docID = args[0] || docApp.docID;
const isApi = isApiDoc(docID);
const doc = docApp.getDoc(docID);
const docInfo = docApp.treeMap.docs.get(docID)
const doc = docInfo.data;
const isChapter = doc?.type === 'chapter';
$.ajaxSubmit(
{
confirm: getLang(isChapter ? (doc.isParent ? 'confirmDeleteChapterWithSub' : 'confirmDeleteChapter') : (doc.isParent ? 'confirmDeleteWithSub' : 'confirmDelete')),
confirm: getLang(isChapter ? (docInfo.docs.length > 0 ? 'confirmDeleteChapterWithSub' : 'confirmDeleteChapter') : (docInfo.docs.length > 0 ? 'confirmDeleteWithSub' : 'confirmDelete')),
url: $.createLink(isApi ? 'api' : 'doc', 'delete', `${isApi ? 'apiID' : 'docID'}=${isApi ? getApiID(docID) : docID}`),
load: false,
onSuccess: function()