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

Method toggle_node

src/jsmind.js:260–278  ·  view source on GitHub ↗

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

(node)

Source from the content-addressed store, hash-verified

258 * @returns {void}
259 */
260 toggle_node(node) {
261 if (!Node.is_node(node)) {
262 var the_node = this.get_node(node);
263 if (!the_node) {
264 logger.error('the node[id=' + node + '] can not be found.');
265 return;
266 } else {
267 this.toggle_node(the_node);
268 return;
269 }
270 }
271 if (node.isroot) {
272 return;
273 }
274 this.view.save_location(node);
275 this.layout.toggle_node(node);
276 this.view.relayout();
277 this.view.restore_location(node);
278 }
279 /**
280 * Expand a node.
281 * @param {string | import('./jsmind.node.js').Node} node

Callers 5

click_handleMethod · 0.95
toggleFunction · 0.45
jsmind.jsFile · 0.45
handle_toggleMethod · 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