Introduce isBefore()
and isAfter()
to view and model nodes
#4318
Labels
package:engine
type:feature
This issue reports a feature request (an idea for a new functionality or a missing option).
Milestone
Similarly to what we have in
model.Position
andview.Position
, we could usemodel.Node#isBefore
andview.Node#isBefore
. Same for#isAfter
. Of course, the methods would compare two nodes and tell if one is before the other one in the tree. If nodes are in different trees, the methods would returnfalse
(just like in positions).This might be useful for example in sorting. Now we have to create positions before items and compare positions. It's not as much of hassle but is also prone to errors (if you'll try to create a position before detached element (root) it will throw).
The text was updated successfully, but these errors were encountered: