-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tooltip and Element creation refactoring
This change started as a refactor of the Tooltip class and turned into a complete overhaul of element building. The previous Tooltip implementation worked by storing tooltip properties (including the stringified tooltip HTML) as element attributes, then retrieving those and reinterpreting the HTML string when going to display the tooltip. This change instead only adds a single attribute to the element - a tooltip id that is used as a dictionary key pointing to a TooltipEntry. The downside of this approach is that as elements are added and removed from the DOM, the dictionary can grow very quickly and start containing entries to elements that will never be reattached to the document. To get around this, keep a weak reference of the target element, and do a sweep every 60 seconds to remove any entries for nodes that have been garbage collected. A tangential change to this was to remove usage of HTML strings in tooltips, instead requiring actual HTMLElements (or plain text strings). To help with this, a TooltipBuilder class was created to build up lines of content instead of various " += `someText<br>`" patterns. This ballooned into a far larger change that completely overhauls the element building pattern. Instead of a single buildNode method, create helpers for each element type. This allows for specializing the parameters, reducing the need to pass in empty/null arguments into buildNode directly.
- Loading branch information
Showing
48 changed files
with
1,594 additions
and
1,196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.