* 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)
| 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 |
no test coverage detected