* Modify module tree locate.

This commit is contained in:
caoyanyi
2023-03-28 16:29:46 +08:00
parent 58c2ca3a27
commit 92f904dc49
3 changed files with 8 additions and 7 deletions
+1
View File
@@ -37,6 +37,7 @@ class api extends control
*/
public function index($objectType = 'nolink', $objectID = 0, $libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0, $browseType = '', $param = 0)
{
if(empty($objectType)) $objectType = 'nolink';
/* Get all api doc libraries. */
$libs = $this->doc->getApiLibs($appendLib, $objectType, $objectID);
if($libID == 0 and !empty($libs))
+4 -5
View File
@@ -22,11 +22,11 @@ $(document).ready(function()
data: treeData,
itemCreator: function($li, item)
{
var libClass = 'lib';
var libClass = item.type == 'api' ? 'lib' : '';
var hasChild = item.children ? !!item.children.length : false;
var $item = '<a href="###" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + '" data-type="' + item.type + '">';
$item += '<div class="text h-full w-full flex-start overflow-hidden">';
if(libClass == 'lib') $item += '<div class="img-lib"></div>';
if(libClass == 'lib') $item += '<div class="img-lib" style="background-image:url(static/svg/interfacelib.svg)"></div>';
$item += '<span style="padding-left: 5px;">';
$item += item.name
$item += '</span>';
@@ -42,6 +42,7 @@ $(document).ready(function()
$('li.has-list > ul, #fileTree').addClass("menu-active-primary menu-hover-primary");
console.log(linkParams)
$('#fileTree').on('mousemove', 'a', function()
{
if($(this).data('type') == 'annex') return;
@@ -65,8 +66,6 @@ $(document).ready(function()
if(isLib)
{
if($(this).data('type') == 'annex') return false;
libID = moduleID;
moduleID = 0;
}
@@ -75,7 +74,7 @@ $(document).ready(function()
libID = $(this).closest('.lib').data('id');
}
linkParams = linkParams.replace('%s', '&libID=' + libID + '&moduleID=' + moduleID);
location.href = createLink('doc', 'tableContents', linkParams);
location.href = createLink('api', 'index', linkParams);
});
});
+3 -2
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->api->confirmDelete);?>
<?php js::set('treeData', $libTree);?>
<?php js::set('linkParams', "objectType=$objectType&objectID=$objectID%s");?>
<div id="mainMenu" class="clearfix">
<div id="leftBar" class="btn-toolbar pull-left">
<?php echo $objectDropdown;?>
@@ -26,8 +27,8 @@
if(common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), "<i class='icon-version muted'> </i>" . $lang->api->releases, '', "class='btn btn-link export' id='export'");
if(common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID", 'html', true), "<i class='icon-publish muted'> </i>" . $lang->api->createRelease, '', "class='btn btn-link export' id='export'");
if(common::hasPriv('api', 'export')) echo html::a($this->createLink('api', 'export', "libID=$libID", 'html', true), "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' id='export'");
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
if(common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "objectTpye=$objectType&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
if(common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "objectTpye=$objectType&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
?>
</div>
</div>