* Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that * should would receive a `mouseEnter` or `mouseLeave` event. * * Does not invoke the callback on the nearest common ancestor because nothing * "entered" or "left" that element.
(from, to, fn, argFrom, argTo)
| 9031 | * "entered" or "left" that element. |
| 9032 | */ |
| 9033 | function traverseEnterLeave(from, to, fn, argFrom, argTo) { |
| 9034 | var common = from && to ? getLowestCommonAncestor(from, to) : null; |
| 9035 | var pathFrom = []; |
| 9036 | while (from && from !== common) { |
| 9037 | pathFrom.push(from); |
| 9038 | from = from._nativeParent; |
| 9039 | } |
| 9040 | var pathTo = []; |
| 9041 | while (to && to !== common) { |
| 9042 | pathTo.push(to); |
| 9043 | to = to._nativeParent; |
| 9044 | } |
| 9045 | var i; |
| 9046 | for (i = 0; i < pathFrom.length; i++) { |
| 9047 | fn(pathFrom[i], true, argFrom); |
| 9048 | } |
| 9049 | for (i = pathTo.length; i-- > 0;) { |
| 9050 | fn(pathTo[i], false, argTo); |
| 9051 | } |
| 9052 | } |
| 9053 | |
| 9054 | module.exports = { |
| 9055 | isAncestor: isAncestor, |
nothing calls this directly
no test coverage detected
searching dependent graphs…