* 选区是否包含节点
(node: INode, excludeRoot = false)
| 123 | * 选区是否包含节点 |
| 124 | */ |
| 125 | containsNode(node: INode, excludeRoot = false) { |
| 126 | for (const id of this._selected) { |
| 127 | const parent = this.doc.getNode(id); |
| 128 | if (excludeRoot && parent?.contains(this.doc.focusNode)) { |
| 129 | continue; |
| 130 | } |
| 131 | if (parent?.contains(node)) { |
| 132 | return true; |
| 133 | } |
| 134 | } |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * 获取选中的节点 |