jsmind 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/jsmind.js CHANGED
@@ -68,7 +68,8 @@
68
68
  layout: {
69
69
  hspace: 30,
70
70
  vspace: 20,
71
- pspace: 13
71
+ pspace: 13,
72
+ cousin_space: 0
72
73
  },
73
74
  default_event_handle: {
74
75
  enable_mousedown_handle: true,
@@ -1033,7 +1034,8 @@
1033
1034
  mode: opts.mode,
1034
1035
  hspace: opts.layout.hspace,
1035
1036
  vspace: opts.layout.vspace,
1036
- pspace: opts.layout.pspace
1037
+ pspace: opts.layout.pspace,
1038
+ cousin_space: opts.layout.cousin_space
1037
1039
  }
1038
1040
  var opts_view = {
1039
1041
  container: opts.container,
@@ -1879,6 +1881,9 @@
1879
1881
  this.set_visible(node.children, false);
1880
1882
  }
1881
1883
  node_outer_height = Math.max(node._data.view.height, node_outer_height);
1884
+ if (node.children.length > 1) {
1885
+ node_outer_height += this.opts.cousin_space;
1886
+ }
1882
1887
 
1883
1888
  layout_data.outer_height = node_outer_height;
1884
1889
  layout_data.offset_y = base_y - node_outer_height / 2;
@@ -1924,6 +1929,9 @@
1924
1929
  node_outer_height = 0;
1925
1930
  }
1926
1931
  node_outer_height = Math.max(node._data.view.height, node_outer_height);
1932
+ if (node.children.length > 1) {
1933
+ node_outer_height += this.opts.cousin_space;
1934
+ }
1927
1935
 
1928
1936
  layout_data.outer_height = node_outer_height;
1929
1937
  layout_data.offset_y = base_y - node_outer_height / 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsmind",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "jsMind is a pure javascript library for mindmap, it base on html5 canvas. jsMind was released under BSD license, you can embed it in any project, if only you observe the license.",
5
5
  "main": "js/jsmind.js",
6
6
  "directories": {