Skip to content

Commit

Permalink
Merge pull request #827 from nextcloud/backport/816/stable25
Browse files Browse the repository at this point in the history
[stable25] Mount menu entry into Vue user menu
  • Loading branch information
Pytal authored Feb 25, 2023
2 parents 3a2a626 + be49a5c commit 60005ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ The First run wizard can be customized to meet specific design goals, or to chan
<navigation>
<id>firstrunwizard_about</id>
<name>About</name>
<route>files.view.index</route>
<icon>info.svg</icon>
<order>99990</order>
<type>settings</type>
Expand Down
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 60005ba

Please sign in to comment.