提交 cf03e14c 编写于 作者: C Catouse

* added dirtyData flag and rerender when window size changed.

上级 0c3f842b
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -4818,6 +4818,7 @@ shortcut = {
this.$ = $(element);
this.options = this.getOptions(options);
this.data = this.options.data;
this.dirtyData = true;
this.init();
};
......@@ -4833,7 +4834,7 @@ shortcut = {
id: $.uuid()
},
nodeTeamplate: "<div class='node expand-{expand}' data-type='{type}' data-id='{id}' data-parent='{parent}'><div class='wrapper'><div class='text' contenteditable='true'>{name}</div><div class='caption'>{caption}</div></div></div>",
hSpace: 150,
hSpace: 120,
vSpace: 20,
lineCurvature: 60,
subLineWidth: 4,
......@@ -4886,6 +4887,8 @@ shortcut = {
$canvas.attr('width', this.width)
.attr('height', this.height);
if(!this.dirtyData) this.showNode(this.data);
}
Mindmap.prototype.computePosition = function(pos)
......@@ -4911,7 +4914,6 @@ shortcut = {
Mindmap.prototype.render = function()
{
this.loadNode(this.data);
console.log(this.data);
this.showNode(this.data);
}
......@@ -5056,6 +5058,8 @@ shortcut = {
{
nodeData.ui.vSpan = vSpan;
}
this.dirtyData = false;
}
/* show on desktop with right position */
......
......@@ -8,6 +8,7 @@
this.$ = $(element);
this.options = this.getOptions(options);
this.data = this.options.data;
this.dirtyData = true;
this.init();
};
......@@ -23,7 +24,7 @@
id: $.uuid()
},
nodeTeamplate: "<div class='node expand-{expand}' data-type='{type}' data-id='{id}' data-parent='{parent}'><div class='wrapper'><div class='text' contenteditable='true'>{name}</div><div class='caption'>{caption}</div></div></div>",
hSpace: 150,
hSpace: 120,
vSpace: 20,
lineCurvature: 60,
subLineWidth: 4,
......@@ -76,6 +77,8 @@
$canvas.attr('width', this.width)
.attr('height', this.height);
if(!this.dirtyData) this.showNode(this.data);
}
Mindmap.prototype.computePosition = function(pos)
......@@ -101,7 +104,6 @@
Mindmap.prototype.render = function()
{
this.loadNode(this.data);
console.log(this.data);
this.showNode(this.data);
}
......@@ -246,6 +248,8 @@
{
nodeData.ui.vSpan = vSpan;
}
this.dirtyData = false;
}
/* show on desktop with right position */
......
......@@ -24,7 +24,6 @@
position: absolute;
border: 2px solid transparent;
border-radius: 22px;
.transition();
&:hover
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册