Skip to content

Commit be49a5c

Browse files
committed
Mount menu entry into Vue user menu
Signed-off-by: Christopher Ng <chrng8@gmail.com>
1 parent 4f12414 commit be49a5c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

js/about.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
document.addEventListener('DOMContentLoaded', function() {
2-
var aboutEntry = document.querySelector('#expanddiv li[data-id="firstrunwizard_about"] a');
3-
if (aboutEntry) {
2+
const aboutEntry = document.querySelector('#firstrunwizard_about button');
3+
4+
const addListener = () => {
5+
const aboutEntry = document.querySelector('#firstrunwizard_about button');
6+
47
aboutEntry.addEventListener('click', function (event) {
58
event.stopPropagation();
69
event.preventDefault();
@@ -13,4 +16,10 @@ document.addEventListener('DOMContentLoaded', function() {
1316
return true;
1417
});
1518
}
19+
20+
if (aboutEntry) {
21+
addListener()
22+
} else {
23+
window._nc_event_bus.subscribe('core:user-menu:mounted', addListener)
24+
}
1625
});

0 commit comments

Comments
 (0)