* [bug#60581,done,1h] Check sub contents.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user