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

Method set_node_background_image

src/jsmind.js:974–999  ·  view source on GitHub ↗

* Set background image for a node. * @param {string} node_id * @param {string=} image * @param {number=} width * @param {number=} height * @param {number=} rotation * @returns {void}

(node_id, image, width, height, rotation)

Source from the content-addressed store, hash-verified

972 * @returns {void}
973 */
974 set_node_background_image(node_id, image, width, height, rotation) {
975 if (this.get_editable()) {
976 var node = this.mind.get_node(node_id);
977 if (!!node) {
978 if (!!image) {
979 node.data['background-image'] = image;
980 }
981 if (!!width) {
982 node.data['width'] = width;
983 }
984 if (!!height) {
985 node.data['height'] = height;
986 }
987 if (!!rotation) {
988 node.data['background-rotation'] = rotation;
989 }
990 this.view.reset_node_custom_style(node);
991 this.view.update_node(node);
992 this.layout.layout();
993 this.view.show(false);
994 }
995 } else {
996 logger.error('fail, this mind map is not editable');
997 return null;
998 }
999 }
1000 /**
1001 * @param {string} node_id
1002 * @param {number} rotation

Callers 3

change_background_imageFunction · 0.80
jsmind.test.jsFile · 0.80

Calls 6

get_editableMethod · 0.95
layoutMethod · 0.80
get_nodeMethod · 0.45
update_nodeMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected