* Modify doc module locate.

This commit is contained in:
caoyanyi
2023-03-21 14:04:37 +08:00
parent 256029b799
commit 6e4cd0dda8
2 changed files with 17 additions and 5 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ span.dotted-line+a {display: block;}
.doc-title ,.item{display: inline-block !important; position: relative; padding-right: 10px; max-width:80%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
.tree li.has-list.open:before {content: unset;}
#modules i.icon-file-text {color: #D0D2D6; font-size: 14px;}
.tree li>a {max-width: 80%;}
.tree li>a {max-width: 100%;}
.sortable-sorting .module-name > a {cursor: move;}
.sortable-sorting li >.tree-group {opacity: .5;}
+16 -4
View File
@@ -98,16 +98,19 @@ $(function()
$('#fileTree').tree(
{
initialState: 'active',
data: treeData,
itemCreator: function($li, item)
{
var libClass = ['lib', 'annex'].indexOf(item.type) !== -1 ? 'lib' : '';
var hasChild = item.children ? !!item.children.length : false;
var $item = '<a href="#" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + (item.type ? 'lib' : '') + '">';
var $item = '<a href="#" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + '">';
$item += '<div class="text h-full w-full flex-center">' + item.name;
$item += '<i class="icon icon-drop icon-ellipsis-v float-r hidden" data-isCatalogue="' + (item.type ? false : true) + '"></i>';
$item += '</div>';
$item += '</a>';
$li.append($item);
$li.addClass(libClass);
if (item.active) $li.addClass('active open in');
}
@@ -120,12 +123,21 @@ $(function()
}).on('mouseout', 'a', function()
{
$(this).find('.icon').addClass('hidden');
}).on('click', 'a', function()
}).on('click', 'a', function(e)
{
var libID = 0;
var isLib = $(this).hasClass('lib');
var moduleID = $(this).data('id');
location.href = createLink('doc', 'tableContents', linkParams + '&libID=' + libID + '&moduleID=' + moduleID);
if(isLib)
{
linkParams += '&libID=' + moduleID;
}
else
{
var libID = $(this).closest('.lib').data('id');
linkParams += '&libID=' + libID + '&moduleID=' + moduleID;
}
location.href = createLink('doc', 'tableContents', linkParams);
});
function renderDropdown(option)