* Expand a node. * @param {string | import('./jsmind.node.js').Node} node * @returns {void}
(node)
| 282 | * @returns {void} |
| 283 | */ |
| 284 | expand_node(node) { |
| 285 | if (!Node.is_node(node)) { |
| 286 | var the_node = this.get_node(node); |
| 287 | if (!the_node) { |
| 288 | logger.error('the node[id=' + node + '] can not be found.'); |
| 289 | return; |
| 290 | } else { |
| 291 | this.expand_node(the_node); |
| 292 | return; |
| 293 | } |
| 294 | } |
| 295 | if (node.isroot) { |
| 296 | return; |
| 297 | } |
| 298 | this.view.save_location(node); |
| 299 | this.layout.expand_node(node); |
| 300 | this.view.relayout(); |
| 301 | this.view.restore_location(node); |
| 302 | } |
| 303 | /** |
| 304 | * Collapse a node. |
| 305 | * @param {string | import('./jsmind.node.js').Node} node |
no test coverage detected