MCPcopy Index your code
hub / github.com/hizzgdev/jsmind / collapse_node

Method collapse_node

src/jsmind.js:308–326  ·  view source on GitHub ↗

* Collapse a node. * @param {string | import('./jsmind.node.js').Node} node * @returns {void}

(node)

Source from the content-addressed store, hash-verified

306 * @returns {void}
307 */
308 collapse_node(node) {
309 if (!Node.is_node(node)) {
310 var the_node = this.get_node(node);
311 if (!the_node) {
312 logger.error('the node[id=' + node + '] can not be found.');
313 return;
314 } else {
315 this.collapse_node(the_node);
316 return;
317 }
318 }
319 if (node.isroot) {
320 return;
321 }
322 this.view.save_location(node);
323 this.layout.collapse_node(node);
324 this.view.relayout();
325 this.view.restore_location(node);
326 }
327 /** Expand all nodes */
328 expand_all() {
329 this.layout.expand_all();

Callers 3

collapseFunction · 0.45
jsmind.jsFile · 0.45
jsmind.test.jsFile · 0.45

Calls 5

get_nodeMethod · 0.95
save_locationMethod · 0.80
relayoutMethod · 0.80
restore_locationMethod · 0.80
is_nodeMethod · 0.45

Tested by

no test coverage detected