From 4c552c2175c4e08d15f48667cfd814b46da37a34 Mon Sep 17 00:00:00 2001 From: guofeilong Date: Thu, 30 Mar 2023 16:14:54 +0800 Subject: [PATCH] * Adjust code . --- module/doc/js/tablecontents.js | 17 +++++++++++------ module/doc/view/tablecontents.html.php | 6 +++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/module/doc/js/tablecontents.js b/module/doc/js/tablecontents.js index 5c32ebe03b..69f2c63e4f 100644 --- a/module/doc/js/tablecontents.js +++ b/module/doc/js/tablecontents.js @@ -86,9 +86,9 @@ $(function() if($module.hasClass('lib')) { libID = $module.data('id'); - moduleType = $module.data('type'); parentID = libID; moduleID = libID; + moduleType = $module.data('type'); } else { @@ -102,7 +102,7 @@ $(function() "libID" : libID, "parentID" : parentID, "objectID" : moduleID, - "moduleType": moduleType == 'lib' ? 'doc' : moduleType, + "moduleType": ['lib', 'execution'].indexOf(moduleType) !== -1 ? 'doc' : moduleType, }; var option = { @@ -223,8 +223,6 @@ $(function() location.href = link }); - - $('body').on('click', function() { $('.dropdown-in-tree').remove(); @@ -353,8 +351,15 @@ $(function() { $.getJSON(createLink('doc', 'tableContents', 'type=' + objectType + '&objectID=' + objectID , 'json'), function(data){ var treeData = JSON.parse(data.data); - $('#fileTree').data('zui.tree').reload(treeData.libTree); - $('li.has-list > ul').addClass("menu-active-primary menu-hover-primary"); + if(Array.isArray(treeData.libTree)) + { + $('#fileTree').data('zui.tree').reload(treeData.libTree); + $('li.has-list > ul').addClass("menu-active-primary menu-hover-primary"); + } + else + { + $tree.data('zui.tree').reload(treeData.libTree[$tree.data('id')]); + } }); } }); diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index 936086b40f..79db24b0e7 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -67,15 +67,15 @@
projectCommon?>
-
+
execution->common?>
-
+
files?>
-
+