From d08a6ac987526e9d307d3db8dcfeeb4eb0ded0db Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Mon, 30 Jan 2023 19:22:38 -0800 Subject: [PATCH] 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) + } });