feat(dia.HighlighterView): enable positioning of highlighter based on opt.z #2866
+42
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change introduces the ability to set the stacking order (
z-index
) for highlighters within the stacking context ofdia.CellView
. Theopt.z
controls whether a highlighter is inserted before or after other elements in the DOM hierarchy.Documentation
Update layer and z sections of the documentation to reflect the changes.
https://docs.jointjs.com/api/dia/HighlighterView/#options
layer
layer - the stacking context of the highlighter. Applicable for mountable highlighters only.
z
z - determines the stacking order (z-index) of the highlighter within the specified layer or directly within dia.CellView.
layer
is defined, the highlighter is inserted into the specified layer at the correct position based onz
.layer
is not defined,z
represents the index within dia.CellView. Ifz
is a valid number and corresponds to an existing child index, the highlighter is inserted before that child (e.g., ifz: 0
, the highlighter will be inserted before the first child element of the dia.CellView - effectively resulting in prepending it under everything else); otherwise, it is appended as the last child.Applicable for mountable highlighters only.