Skip to content
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

If a top menu entry opens a modal box, don't mark it as active when clicked #6863

Merged
merged 2 commits into from Feb 24, 2024

Conversation

marc-farre
Copy link
Collaborator

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • It's submitted to the develop branch, not the master branch if no hotfix
  • When resolving a specific issue, it's referenced in the PR's description (e.g. Fix #xxx[,#xxx], where "xxx" is the Github issue number)
  • All tests are passing
  • New/updated tests are included
  • Changelog was modified

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

Copy link

what-the-diff bot commented Feb 24, 2024

PR Summary

  • Fix for Issue If a top menu entry opens a modal box, don't mark it as active when clicked #6863
    The update provides a solution for a previously reported problem. If a button on the main navigation menu opened a popup window, the system wrongly marked this button as 'active'. This was confusing for users as 'active' usually refers to the currently opened page.

  • Updates in humhub.ui.navigation.js
    Changes have been made to the logic that controls how menu items behave when clicked. Specifically, we've made it so that certain menu items (which are identified by their IDs or other attributes) don't get marked as 'active' when clicked. So, if a menu item is meant to open a separate window or action, it won’t give a false impression of being the current page.

@marc-farre
Copy link
Collaborator Author

@luke- this PR fixes the issue with top menu entries opening the page in a modal box.

I've also replaced the if (!$this.is('#space-menu') && !$this.is('#top-dropdown-menu')) with :not(#space-menu):not(#top-dropdown-menu) in the CSS search. If you think it's not a good idea, I can revert this.

Use case:

$topMenu->addEntry(new MenuLink([
    'url' => '#',
    'htmlOptions' => [
        'data-action-click' => 'ui.modal.load',
        'data-action-click-url' => Url::to(['/my-module/index/index']),
    ],
    ...
]));

Thanks.

@luke- luke- added this pull request to the merge queue Feb 24, 2024
Merged via the queue into develop with commit a5aaa65 Feb 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants