mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-08-20 12:30:44 +02:00
- Partially fix relationship to central topic.
- Fix add icon to the central topic
This commit is contained in:
parent
bc87d0f311
commit
e520d9baba
@ -590,6 +590,7 @@ mindplot.Designer = new Class({
|
||||
var validateFunc = function(topic) {
|
||||
return !(topic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.INodeModel.SHAPE_TYPE_LINE)
|
||||
};
|
||||
|
||||
var validateError = 'Central Topic shape can not be changed to line figure.';
|
||||
var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError);
|
||||
if (topicsIds.length > 0) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
mindplot.commands.AddIconToTopicCommand = new Class({
|
||||
Extends:mindplot.Command,
|
||||
initialize: function(topicId, iconType) {
|
||||
$assert(topicId, 'topicId can not be null');
|
||||
$assert($defined(topicId), 'topicId can not be null');
|
||||
$assert(iconType, 'iconType can not be null');
|
||||
this._objectsIds = topicId;
|
||||
this._iconType = iconType;
|
||||
|
@ -95,11 +95,11 @@ mindplot.model.Mindmap = new Class({
|
||||
return new mindplot.model.NodeModel(type, this, id);
|
||||
},
|
||||
|
||||
createRelationship : function(fromNode, toNode) {
|
||||
$assert(fromNode, 'from node cannot be null');
|
||||
$assert(toNode, 'to node cannot be null');
|
||||
createRelationship : function(sourceNodeId, targetNodeId) {
|
||||
$assert($defined(sourceNodeId), 'from node cannot be null');
|
||||
$assert($defined(targetNodeId), 'to node cannot be null');
|
||||
|
||||
return new mindplot.model.RelationshipModel(fromNode, toNode);
|
||||
return new mindplot.model.RelationshipModel(sourceNodeId, targetNodeId);
|
||||
},
|
||||
|
||||
addRelationship : function(relationship) {
|
||||
|
@ -16,13 +16,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
mindplot.model.RelationshipModel = new Class({
|
||||
initialize:function(fromNode, toNode) {
|
||||
$assert(fromNode, 'from node type can not be null');
|
||||
$assert(toNode, 'to node type can not be null');
|
||||
initialize:function(sourceTopicId, targetTopicId) {
|
||||
$assert($defined(sourceTopicId), 'from node type can not be null');
|
||||
$assert($defined(targetTopicId), 'to node type can not be null');
|
||||
|
||||
this._id = mindplot.model.RelationshipModel._nextUUID();
|
||||
this._fromNode = fromNode;
|
||||
this._toNode = toNode;
|
||||
this._sourceTargetId = sourceTopicId;
|
||||
this._targetTopicId = targetTopicId;
|
||||
this._lineType = mindplot.ConnectionLine.SIMPLE_CURVED;
|
||||
this._srcCtrlPoint = null;
|
||||
this._destCtrlPoint = null;
|
||||
@ -31,11 +31,11 @@ mindplot.model.RelationshipModel = new Class({
|
||||
},
|
||||
|
||||
getFromNode : function() {
|
||||
return this._fromNode;
|
||||
return this._sourceTargetId;
|
||||
},
|
||||
|
||||
getToNode : function() {
|
||||
return this._toNode;
|
||||
return this._targetTopicId;
|
||||
},
|
||||
|
||||
getId : function() {
|
||||
@ -83,7 +83,7 @@ mindplot.model.RelationshipModel = new Class({
|
||||
},
|
||||
|
||||
clone : function(model) {
|
||||
var result = new mindplot.model.RelationshipModel(this._fromNode, this._toNode);
|
||||
var result = new mindplot.model.RelationshipModel(this._sourceTargetId, this._targetTopicId);
|
||||
result._id = this._id;
|
||||
result._lineType = this._lineType;
|
||||
result._srcCtrlPoint = this._srcCtrlPoint;
|
||||
|
Loading…
Reference in New Issue
Block a user