Skip to content

Convert NavTreeMenu rendering to DOM and fix its click handlers - #8398

Open
labkey-adam wants to merge 1 commit into
developfrom
fb_nav_tree_menu_dom
Open

labkey-adam wants to merge 1 commit into
developfrom
fb_nav_tree_menu_dom

Conversation

@labkey-adam

Copy link
Copy Markdown
Contributor

Rationale

This PR moves NavTreeMenu rendering from hand-built HTML to DOM and LinkBuilder, and fixes several bugs in its click handling and link attributes along the way.

Related Pull Requests

Changes

  • Render menu rows, expand/collapse toggles, and links with DOM and LinkBuilder, writing directly to the HtmlWriter
  • Register a node's click script once, unencoded, on its link (or on the cell when there is no link)
  • Escape link targets and add rel="noopener noreferrer" to links that open a new tab
  • Compute the current-page selection match once per menu instead of once per node

Tasks

  • Manual Testing
  • Verify Fix

Click scripts were HTML-encoded before registration, ran twice on linked nodes, and could throw on nodes without an id; link targets were also unescaped.
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.

1 participant