UNPKG

@atlaskit/editor-plugin-floating-toolbar

Version:

Floating toolbar plugin for @atlaskit/editor-core

16 lines 367 B
// find node in descendants by condition export function findNode(parent, predicate) { var matchedNode; parent.descendants(function (node) { // dont run predicate if node already found if (matchedNode) { return false; } if (predicate(node)) { matchedNode = node; return false; } return true; }); return matchedNode; }