From 0de87f1c778a81ab30c596889325116277ac0201 Mon Sep 17 00:00:00 2001 From: guofeilong Date: Wed, 22 Mar 2023 14:43:20 +0800 Subject: [PATCH] * Adjust code . --- module/doc/js/tablecontents.js | 39 +++++++++++++------------- module/doc/view/tablecontents.html.php | 10 +++---- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/module/doc/js/tablecontents.js b/module/doc/js/tablecontents.js index c6a9e3e106..0f20733c88 100644 --- a/module/doc/js/tablecontents.js +++ b/module/doc/js/tablecontents.js @@ -149,15 +149,6 @@ $(function() return dropdown; }; - function refreshDropdown(option) - { - $('#' + option.type).css({ - 'display': 'unset', - 'left': option.left, - 'top': option.top - }); - }; - $('#fileTree').on('click', '.icon-drop', function(e) { $('.dropdown-in-tree').css('display', 'none'); @@ -183,23 +174,33 @@ $(function() libID : libID, moduleID : moduleID }; - if (!$('#' + dropDownID).length) - { - var dropDown = renderDropdown(option); - $("body").append(dropDown); - } - else - { - refreshDropdown(option) - } + var dropDown = renderDropdown(option); + $("body").append(dropDown); e.stopPropagation(); }); $('body').on('click', function(e) { - if(!$.contains(e.target, $('.dropdown-in-tree'))) $('.dropdown-in-tree').css('display', 'none'); + if(!$.contains(e.target, $('.dropdown-in-tree'))) $('.dropdown-in-tree').remove(); + }).on('click', '.dropdown-in-tree li', function(e) + { + var item = $(this).data(); + if(item.type !== 'add') return; + console.log(item); + switch(item.method) + { + case 'addCataLib' : + break; + case 'addCata' : + break; + case 'addCataChild' : + break; + } }); + /* + * + */ function initSplitRow() { /* Init split row. */ diff --git a/module/doc/view/tablecontents.html.php b/module/doc/view/tablecontents.html.php index 17e54159db..d859439275 100644 --- a/module/doc/view/tablecontents.html.php +++ b/module/doc/view/tablecontents.html.php @@ -69,9 +69,7 @@ - +
>