From 11233e58ab431af5bed48101e5dbf44d2b19f5fe Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Mon, 20 Jan 2025 15:58:40 +0800 Subject: [PATCH 1/2] Fix lazy-expand menu click problem --- modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 33f0f3b539..3012da1e56 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -376,7 +376,7 @@ var doc = doc || {}; var initLazyExpandNavigation = function(){ $("li .lazy-expand").off('click'); - $("li .lazy-expand a").on('click', function(e){ + $("li .lazy-expand").children("a").on('click', function(e){ if($(this).attr("href") !== "javascript:;"){ e.stopPropagation(); } From b0748c6e82683080f6d1c876b361ccce67be5880 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 22 Jan 2025 19:52:02 +0800 Subject: [PATCH 2/2] Update index.js --- .../src/Volo.Docs.Web/Pages/Documents/Project/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js index 3012da1e56..6636787f33 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js @@ -24,7 +24,7 @@ var doc = doc || {}; return; } - var textCss = node.path === "javascript:;" ? "": "tree-toggle"; + var textCss = node.path === "javascript:;" ? "tree-toggle" : ""; var uiCss = isRootLazyNode ? "" : "style='display: none;'"; var $ul = $(``); var $li = $(`
  • `); @@ -58,8 +58,6 @@ var doc = doc || {}; doc.lazyExpandableNavigation.isAllLoaded = false; doc.lazyExpandableNavigation.loadAll(childLazyLiElements); } - - initLazyExpandNavigation(); } doc.lazyExpandableNavigation.isAllLoaded = true; @@ -80,6 +78,8 @@ var doc = doc || {}; node.items.forEach(item => { doc.lazyExpandableNavigation.renderNodeAsHtml($li, item, true); }) + + initLazyExpandNavigation(); } } @@ -376,6 +376,7 @@ var doc = doc || {}; var initLazyExpandNavigation = function(){ $("li .lazy-expand").off('click'); + $("li .lazy-expand").children("a").off('click'); $("li .lazy-expand").children("a").on('click', function(e){ if($(this).attr("href") !== "javascript:;"){ e.stopPropagation(); @@ -383,7 +384,6 @@ var doc = doc || {}; }); $("li .lazy-expand").on('click', function(){ doc.lazyExpandableNavigation.load(this); - initLazyExpandNavigation(); }); }