-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add event to highlight active menu #51207
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Kostiantyn Miakshyn <[email protected]>
cbe5811
to
15a1b00
Compare
@@ -88,10 +88,12 @@ export default defineComponent({ | |||
|
|||
mounted() { | |||
subscribe('nextcloud:app-menu.refresh', this.setApps) | |||
subscribe('nextcloud:app-menu.active', this.setActive) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO method in OC
namespace is better. This allow us to write more universal apps to support multiple NC versions:
if (OC.setNavigationActive) {
// we are on newer NC api and can use method
} else {
// we are on legacy NC api and should do css manipulations to preserve BC
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OC.
shall not be used by apps, its private API and might change at any time.
Also OCP.
is deprecated as we aim to remove all exposed global states and only provide version agnostic API through packages.
I do not get the use case here as it is not possible to switch apps without reloading the page? |
@@ -88,10 +88,12 @@ export default defineComponent({ | |||
|
|||
mounted() { | |||
subscribe('nextcloud:app-menu.refresh', this.setApps) | |||
subscribe('nextcloud:app-menu.active', this.setActive) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subscribe('nextcloud:app-menu.active', this.setActive) | |
subscribe('nextcloud:app-menu:activate', this.setActive) |
https://github.com/nextcloud-libraries/nextcloud-event-bus?tab=readme-ov-file#naming-convention
See nextcloud/tables#1477 (comment)
Summary
Right now some modules uses css manipulations to mark some items as active. Would be nice to have proper API for that.
TODO
OC
methodChecklist