From c2670d514012415120da0a0e9b048735abe01331 Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Sun, 9 Oct 2011 18:38:41 -0300 Subject: [PATCH] Several issues fixed. --- mindplot/src/main/javascript/BoardEntry.js | 4 ++-- mindplot/src/main/javascript/ConnectionLine.js | 4 +--- mindplot/src/main/javascript/Designer.js | 2 ++ mindplot/src/main/javascript/Topic.js | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mindplot/src/main/javascript/BoardEntry.js b/mindplot/src/main/javascript/BoardEntry.js index a9c8f64c..e338afcb 100644 --- a/mindplot/src/main/javascript/BoardEntry.js +++ b/mindplot/src/main/javascript/BoardEntry.js @@ -42,7 +42,7 @@ mindplot.BoardEntry = new Class({ }, setUpperLimit : function(value) { - $assert(value, "upper limit can not be null"); + $assert(!isNaN(value), "upper limit can not be null"); $assert(!isNaN(value), "illegal value"); this._upperLimit = value; }, @@ -56,7 +56,7 @@ mindplot.BoardEntry = new Class({ }, setLowerLimit : function(value) { - $assert(value, "upper limit can not be null"); + $assert(!isNaN(value), "upper limit can not be null"); $assert(!isNaN(value), "illegal value"); this._lowerLimit = value; }, diff --git a/mindplot/src/main/javascript/ConnectionLine.js b/mindplot/src/main/javascript/ConnectionLine.js index 878eea54..9c6f532b 100644 --- a/mindplot/src/main/javascript/ConnectionLine.js +++ b/mindplot/src/main/javascript/ConnectionLine.js @@ -27,10 +27,10 @@ mindplot.ConnectionLine = new Class({ var strokeColor = mindplot.ConnectionLine.getStrokeColor(); var line; + var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode); if (targetNode.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { line = this._createLine(lineType, mindplot.ConnectionLine.CURVED); if (line.getType() == "CurvedLine") { - var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode); line.setSrcControlPoint(ctrlPoints[0]); line.setDestControlPoint(ctrlPoints[1]); } @@ -38,11 +38,9 @@ mindplot.ConnectionLine = new Class({ } else { line = this._createLine(lineType, mindplot.ConnectionLine.SIMPLE_CURVED); if (line.getType() == "CurvedLine") { - var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode); line.setSrcControlPoint(ctrlPoints[0]); line.setDestControlPoint(ctrlPoints[1]); } - // line = new web2d.PolyLine(); line.setStroke(1, 'solid', strokeColor); } diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 3ed18876..fb265966 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -333,8 +333,10 @@ mindplot.Designer = new Class({ $assert(targetTopic, "targetTopic can not be null"); // Create a new topic model ... + // @Todo: Model should not be modified from here ... var mindmap = this.getMindmap(); var model = mindmap.createRelationship(sourceTopic.getModel().getId(), targetTopic.getModel().getId()); + this._actionDispatcher.connectByRelation(model); }, diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 3fb02e24..a0e52661 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -319,6 +319,8 @@ mindplot.Topic = new Class({ addIcon : function(iconType) { var iconGroup = this.getOrBuildIconGroup(); + this.closeEditors(); + var model = this.getModel(); // Update model ...