mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
Fix exception on changing central topic shape.
This commit is contained in:
parent
0f2af2cb74
commit
0660c7e8c3
@ -90,5 +90,9 @@ mindplot.CentralTopic = new Class({
|
|||||||
weight:"bold",
|
weight:"bold",
|
||||||
color:"#ffffff"
|
color:"#ffffff"
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
getShrinkConnector : function() {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -131,13 +131,15 @@ mindplot.ConnectionLine = new Class({
|
|||||||
y = y - offset;
|
y = y - offset;
|
||||||
|
|
||||||
var connector = targetTopic.getShrinkConnector();
|
var connector = targetTopic.getShrinkConnector();
|
||||||
if (Math.sign(targetPosition.x) > 0) {
|
if ($defined(connector)) {
|
||||||
var x = targetTopicSize.width;
|
if (Math.sign(targetPosition.x) > 0) {
|
||||||
connector.setPosition(x, y);
|
var x = targetTopicSize.width;
|
||||||
}
|
connector.setPosition(x, y);
|
||||||
else {
|
}
|
||||||
var x = -mindplot.Topic.CONNECTOR_WIDTH;
|
else {
|
||||||
connector.setPosition(x, y);
|
var x = -mindplot.Topic.CONNECTOR_WIDTH;
|
||||||
|
connector.setPosition(x, y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ mindplot.Designer = new Class({
|
|||||||
$assert(mindmapModel, "mindmapModel can not be null");
|
$assert(mindmapModel, "mindmapModel can not be null");
|
||||||
this._mindmap = mindmapModel;
|
this._mindmap = mindmapModel;
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
// Init layout manager ...
|
// Init layout manager ...
|
||||||
var size = {width:25,height:25};
|
var size = {width:25,height:25};
|
||||||
var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size);
|
var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size);
|
||||||
@ -485,9 +485,9 @@ mindplot.Designer = new Class({
|
|||||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout);
|
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout);
|
||||||
|
|
||||||
this.fireEvent('loadSuccess');
|
this.fireEvent('loadSuccess');
|
||||||
} catch(e) {
|
// } catch(e) {
|
||||||
this.fireEvent('loadError', e);
|
// this.fireEvent('loadError', e);
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
|
|
||||||
getMindmap : function() {
|
getMindmap : function() {
|
||||||
|
@ -93,6 +93,7 @@ mindplot.Topic = new Class({
|
|||||||
if ($defined(iconGroup)) {
|
if ($defined(iconGroup)) {
|
||||||
iconGroup.moveToFront();
|
iconGroup.moveToFront();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Move connector to front
|
//Move connector to front
|
||||||
var connector = this.getShrinkConnector();
|
var connector = this.getShrinkConnector();
|
||||||
if ($defined(connector)) {
|
if ($defined(connector)) {
|
||||||
@ -489,7 +490,9 @@ mindplot.Topic = new Class({
|
|||||||
innerShape.setFill(color);
|
innerShape.setFill(color);
|
||||||
|
|
||||||
var connector = this.getShrinkConnector();
|
var connector = this.getShrinkConnector();
|
||||||
connector.setFill(color);
|
if (connector) {
|
||||||
|
connector.setFill(color);
|
||||||
|
}
|
||||||
|
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
@ -515,8 +518,9 @@ mindplot.Topic = new Class({
|
|||||||
innerShape.setAttribute('strokeColor', color);
|
innerShape.setAttribute('strokeColor', color);
|
||||||
|
|
||||||
var connector = this.getShrinkConnector();
|
var connector = this.getShrinkConnector();
|
||||||
connector.setAttribute('strokeColor', color);
|
if (connector) {
|
||||||
|
connector.setAttribute('strokeColor', color);
|
||||||
|
}
|
||||||
|
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
@ -542,7 +546,6 @@ mindplot.Topic = new Class({
|
|||||||
var outerShape = this.getOuterShape();
|
var outerShape = this.getOuterShape();
|
||||||
var innerShape = this.getInnerShape();
|
var innerShape = this.getInnerShape();
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
var shrinkConnector = this.getShrinkConnector();
|
|
||||||
|
|
||||||
// Add to the group ...
|
// Add to the group ...
|
||||||
group.appendChild(outerShape);
|
group.appendChild(outerShape);
|
||||||
@ -555,7 +558,8 @@ mindplot.Topic = new Class({
|
|||||||
this.getOrBuildIconGroup();
|
this.getOrBuildIconGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
var shrinkConnector = this.getShrinkConnector();
|
||||||
|
if ($defined(shrinkConnector)) {
|
||||||
shrinkConnector.addToWorkspace(group);
|
shrinkConnector.addToWorkspace(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,7 +619,9 @@ mindplot.Topic = new Class({
|
|||||||
// Change render base on the state.
|
// Change render base on the state.
|
||||||
|
|
||||||
var shrinkConnector = this.getShrinkConnector();
|
var shrinkConnector = this.getShrinkConnector();
|
||||||
shrinkConnector.changeRender(value);
|
if ($defined(shrinkConnector)) {
|
||||||
|
shrinkConnector.changeRender(value);
|
||||||
|
}
|
||||||
|
|
||||||
// Do some fancy animation ....
|
// Do some fancy animation ....
|
||||||
var elements = this._flatten2DElements(this);
|
var elements = this._flatten2DElements(this);
|
||||||
@ -874,7 +880,9 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
if (this.getIncomingLines().length > 0) {
|
if (this.getIncomingLines().length > 0) {
|
||||||
var connector = this.getShrinkConnector();
|
var connector = this.getShrinkConnector();
|
||||||
connector.setVisibility(value);
|
if ($defined(connector)) {
|
||||||
|
connector.setVisibility(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
@ -885,8 +893,10 @@ mindplot.Topic = new Class({
|
|||||||
var elem = this.get2DElement();
|
var elem = this.get2DElement();
|
||||||
elem.setOpacity(opacity);
|
elem.setOpacity(opacity);
|
||||||
|
|
||||||
this.getShrinkConnector().setOpacity(opacity);
|
var connector = this.getShrinkConnector();
|
||||||
|
if ($defined(connector)) {
|
||||||
|
connector.setOpacity(opacity);
|
||||||
|
}
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setOpacity(opacity);
|
textShape.setOpacity(opacity);
|
||||||
},
|
},
|
||||||
@ -986,7 +996,9 @@ mindplot.Topic = new Class({
|
|||||||
// Hide connection line?.
|
// Hide connection line?.
|
||||||
if (targetTopic.getChildren().length == 0) {
|
if (targetTopic.getChildren().length == 0) {
|
||||||
var connector = targetTopic.getShrinkConnector();
|
var connector = targetTopic.getShrinkConnector();
|
||||||
connector.setVisibility(false);
|
if ($defined(connector)) {
|
||||||
|
connector.setVisibility(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1041,7 +1053,9 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
// Display connection node...
|
// Display connection node...
|
||||||
var connector = targetTopic.getShrinkConnector();
|
var connector = targetTopic.getShrinkConnector();
|
||||||
connector.setVisibility(true);
|
if ($defined(connector)) {
|
||||||
|
connector.setVisibility(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Redraw line ...
|
// Redraw line ...
|
||||||
outgoingLine.redraw();
|
outgoingLine.redraw();
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var mapId = 'welcome-reloaded';
|
var mapId = 'welcome';
|
||||||
$(document).addEvent('loadcomplete', function(resource) {
|
$(document).addEvent('loadcomplete', function(resource) {
|
||||||
var options = loadDesignerOptions();
|
var options = loadDesignerOptions();
|
||||||
var designer = buildDesigner(options);
|
var designer = buildDesigner(options);
|
||||||
|
@ -30,17 +30,12 @@ function buildDesigner(options) {
|
|||||||
window.waitDialog.destroy();
|
window.waitDialog.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register error handlers ...
|
window.onerror = function()
|
||||||
designer.addEvent('loadError', function(e) {
|
{
|
||||||
window.waitDialog.close();
|
window.waitDialog.close();
|
||||||
window.waitDialog.destroy();
|
window.waitDialog.destroy();
|
||||||
errorDialog.show();
|
errorDialog.show();
|
||||||
console.log(e);
|
console.log(e);
|
||||||
});
|
|
||||||
|
|
||||||
window.onerror = function()
|
|
||||||
{
|
|
||||||
errorDialog.show();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Configure default persistence manager ...
|
// Configure default persistence manager ...
|
||||||
|
Loading…
Reference in New Issue
Block a user