diff --git a/lib/zin/wg/docmenu/js/v1.js b/lib/zin/wg/docmenu/js/v1.js index b1734169ae..3eed70ef02 100644 --- a/lib/zin/wg/docmenu/js/v1.js +++ b/lib/zin/wg/docmenu/js/v1.js @@ -31,10 +31,11 @@ window.addModule = function(id, addType) const {lib, type, module} = $element.data(); let parentID = ['docLib', 'apiLib'].includes(type) ? '0' : $element.data('parent'); + let level = $element.closest('.tree-item').attr('z-key-path').split(':').length; if(addType == 'child' && !['docLib', 'apiLib'].includes(type)) parentID = id; + if(addType != 'same') level += 1; - const level = addType == 'same' ? $element.data('level') : $element.data('level') + 1; - const style = `style="margin-left: calc(${level} * var(--list-nested-indent, 20px))"`; + const style = `style="margin-left: calc(${level} * 12px)"`; const className = addType == 'child' && ['docLib', 'apiLib'].includes(type) ? 'mt-2' : ''; let inputTpl = `