diff --git a/mindplot/src/main/javascript/ActionDispatcher.js b/mindplot/src/main/javascript/ActionDispatcher.js index 15a14c8e..ecf15e99 100644 --- a/mindplot/src/main/javascript/ActionDispatcher.js +++ b/mindplot/src/main/javascript/ActionDispatcher.js @@ -94,8 +94,14 @@ mindplot.ActionDispatcher = new Class({ changeFontWeightToTopic : function(topicsIds) { throw "method must be implemented."; }, + changeTextOnTopic : function(topicsIds, text) { throw "method must be implemented."; + }, + + shrinkBranch : function(topicsIds, collapse) + { + throw "method must be implemented."; } }); diff --git a/mindplot/src/main/javascript/DragPivot.js b/mindplot/src/main/javascript/DragPivot.js index d121dff6..7c8482d2 100644 --- a/mindplot/src/main/javascript/DragPivot.js +++ b/mindplot/src/main/javascript/DragPivot.js @@ -201,8 +201,11 @@ mindplot.DragPivot = new Class({ // Connected to Rect ... var connectRect = this._connectRect; var targetSize = targetTopic.getSize(); - var width = targetSize.width; - var height = targetSize.height; + + // Add 4 pixel in order to keep create a rect bigger than the topic. + var width = targetSize.width + 4; + var height = targetSize.height + 4; + connectRect.setSize(width, height); var targetPosition = targetTopic.getPosition(); diff --git a/mindplot/src/main/javascript/DragTopicPositioner.js b/mindplot/src/main/javascript/DragTopicPositioner.js index db03af19..7e5e4636 100644 --- a/mindplot/src/main/javascript/DragTopicPositioner.js +++ b/mindplot/src/main/javascript/DragTopicPositioner.js @@ -71,7 +71,8 @@ mindplot.DragTopicPositioner = new Class({ // Finally, connect nodes ... if (!dragTopic.isConnected()) { var centalTopic = topics[0]; - if ($defined(mainTopicToMainTopicConnection)) { + if ($defined(mainTopicToMainTopicConnection)) + { dragTopic.connectTo(mainTopicToMainTopicConnection); } else if (Math.abs(dragTopic.getPosition().x - centalTopic.getPosition().x) <= mindplot.DragTopicPositioner.CENTRAL_TO_MAINTOPIC_MAX_HORIZONTAL_DISTANCE) { dragTopic.connectTo(centalTopic); @@ -82,7 +83,6 @@ mindplot.DragTopicPositioner = new Class({ _lookUpForMainTopicToMainTopicConnection : function(dragTopic) { var topics = this._topics; var result = null; - var clouserDistance = -1; var draggedNode = dragTopic.getDraggedTopic(); var distance = null; diff --git a/mindplot/src/main/javascript/LocalActionDispatcher.js b/mindplot/src/main/javascript/LocalActionDispatcher.js index fcb84471..b32b96da 100644 --- a/mindplot/src/main/javascript/LocalActionDispatcher.js +++ b/mindplot/src/main/javascript/LocalActionDispatcher.js @@ -220,6 +220,18 @@ mindplot.LocalActionDispatcher = new Class({ this.execute(command); }, + shrinkBranch : function(topicsIds, collapse) { + $assert(topicsIds, "topicsIds can not be null"); + + var commandFunc = function(topic, isShrink) { + topic.setChildrenShrinked(isShrink); + return !isShrink; + }; + + var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, collapse); + this.execute(command); + }, + execute:function(command) { this._actionRunner.execute(command); } diff --git a/mindplot/src/main/javascript/ShrinkConnector.js b/mindplot/src/main/javascript/ShrinkConnector.js index 5a661d9b..ed8356d0 100644 --- a/mindplot/src/main/javascript/ShrinkConnector.js +++ b/mindplot/src/main/javascript/ShrinkConnector.js @@ -26,18 +26,11 @@ mindplot.ShirinkConnector = new Class({ elipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH); elipse.addEventListener('click', function(event) { var model = topic.getModel(); - var isShrink = !model.areChildrenShrinked(); + var collapse = !model.areChildrenShrinked(); - var actionRunner = mindplot.DesignerActionRunner.getInstance(); var topicId = topic.getId(); - - var commandFunc = function(topic, isShrink) { - topic.setChildrenShrinked(isShrink); - return !isShrink; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, isShrink, [topicId]); - actionRunner.execute(command); + var actionDispatcher = mindplot.ActionDispatcher.getInstance(); + actionDispatcher.shrinkBranch([topicId],collapse); var e = new Event(event).stop(); e.preventDefault(); diff --git a/wise-doc/src/main/webapp/html/editor.html b/wise-doc/src/main/webapp/html/editor.html index 374cf42b..f3eed0ab 100644 --- a/wise-doc/src/main/webapp/html/editor.html +++ b/wise-doc/src/main/webapp/html/editor.html @@ -12,7 +12,9 @@ + + @@ -25,6 +27,9 @@ +'> + + @@ -69,14 +74,10 @@ // @Todo: This must be persited in the map properties ... var mapId = '1'; var mapXml = ''; - - var editorProperties = {zoom:0.85,saveOnLoad:true}; - function printMap() { - document.printForm.mapSvg.value = $("workspaceContainer").innerHTML; - document.printForm.submit(); - } + +
diff --git a/wise-doc/src/main/webapp/js/editor.js b/wise-doc/src/main/webapp/js/editor.js index 32a320e1..97d668f0 100644 --- a/wise-doc/src/main/webapp/js/editor.js +++ b/wise-doc/src/main/webapp/js/editor.js @@ -365,7 +365,7 @@ function buildMindmapDesigner() { var screenHeight = window.getHeight(); // header - footer - screenHeight = screenHeight-115; + screenHeight = screenHeight - 115; // body margin ... editorProperties.width = screenWidth; @@ -391,8 +391,7 @@ function createColorPalette(container, onSelectFunction, event) { var colorPaletteElement = $("colorPalette"); colorPaletteElement.setStyle('left', (mouseCoords.x - 80) + "px"); colorPaletteElement.setStyle('display', "block"); -} -; +}; function cleanScreenEvent() { if (this.currentColorPicker) { @@ -435,9 +434,8 @@ function shapeTypePanel() { function fontSizePanel() { var shapeTypePanel = ['small','normal','large','huge']; var map = {small:'6',normal:'8',large:'10',huge:'15'}; - var updateFunction = function(value) { - var nodes = designer.getSelectedNodes(); - var value = map[value]; + var updateFunction = function(key) { + var value = map[key]; designer.setFontSize2SelectedNode(value); }; @@ -488,7 +486,6 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio if (!isRendered) { container.setStyle('left', (mouseCoords.x - 10) + "px"); } - }); var fontOnClick = function(event) {