From 67c01ce20703568f1c0aa84076b0ef36614f495a Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 9 Feb 2023 11:08:20 -0800 Subject: [PATCH 1/2] Remove unused route link - The user menu entry should not show a link when it is meant to open a modal Signed-off-by: Christopher Ng --- appinfo/info.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index f6a9920f8..377e7e392 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -37,7 +37,6 @@ The First run wizard can be customized to meet specific design goals, or to chan firstrunwizard_about About - files.view.index info.svg 99990 settings From 02c2e5d72ffc894a25cc48c131dde43255b0a676 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 9 Feb 2023 11:08:20 -0800 Subject: [PATCH 2/2] Mount menu entry into Vue user menu Signed-off-by: Christopher Ng --- js/about.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/about.js b/js/about.js index 2cf11a612..9a3209d08 100644 --- a/js/about.js +++ b/js/about.js @@ -1,6 +1,9 @@ document.addEventListener('DOMContentLoaded', function() { - var aboutEntry = document.querySelector('#expanddiv li[data-id="firstrunwizard_about"] a'); - if (aboutEntry) { + const aboutEntry = document.querySelector('#firstrunwizard_about button'); + + const addListener = () => { + const aboutEntry = document.querySelector('#firstrunwizard_about button'); + aboutEntry.addEventListener('click', function (event) { event.stopPropagation(); event.preventDefault(); @@ -13,4 +16,10 @@ document.addEventListener('DOMContentLoaded', function() { return true; }); } + + if (aboutEntry) { + addListener() + } else { + window._nc_event_bus.subscribe('core:user-menu:mounted', addListener) + } });