Add event bubbling support for Infoboxes

Review Request #9306 — Created Oct. 22, 2017 and discarded — Latest diff uploaded

Information

Review Board
master

Reviewers

Currently the only mechanism to register Infoboxes is to pass in a list of elements to InfoboxManagerView.addTargets. This creates event listeners on each individual element. This mechanism is okay when the number of elements is small, however becomes ineficient when needing to listen for events on a large number of elements.

This change adds a new mechanism addContainerSelector to InfoboxManagerView. Instead of adding listeners to each element, addContainerSelector registers a single listener on the parent container which listens and triggers events for the children specified in the selector.

  • Existing unit tests passed
  • Two new unit tests passed
  • Manual testing: created a dummy infobox type and added it to DiffReviewableView on all '.n' Pygments classes. Ensured events triggered when hovering over specified classes, but not when hovering over non-specified classes. This manual testing only covered the mouseenter events and not the mouseleave events.
    Loading...