Skip to content

Commit

Permalink
Mount menu entry into Vue user menu
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Jan 27, 2023
1 parent 0fd7b36 commit 830594e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions js/about.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -13,4 +16,10 @@ document.addEventListener('DOMContentLoaded', function() {
return true;
});
}

if (aboutEntry) {
addListener()
} else {
window._nc_event_bus.subscribe('core:user-menu:mounted', addListener)
}
});

0 comments on commit 830594e

Please sign in to comment.