Fix missing migrated event...

This commit is contained in:
Paulo Veiga 2011-08-05 01:34:51 -03:00
parent 36e44c13ca
commit b15ff84a94
7 changed files with 39 additions and 27 deletions

View File

@ -94,8 +94,14 @@ mindplot.ActionDispatcher = new Class({
changeFontWeightToTopic : function(topicsIds) { changeFontWeightToTopic : function(topicsIds) {
throw "method must be implemented."; throw "method must be implemented.";
}, },
changeTextOnTopic : function(topicsIds, text) { changeTextOnTopic : function(topicsIds, text) {
throw "method must be implemented."; throw "method must be implemented.";
},
shrinkBranch : function(topicsIds, collapse)
{
throw "method must be implemented.";
} }
}); });

View File

@ -201,8 +201,11 @@ mindplot.DragPivot = new Class({
// Connected to Rect ... // Connected to Rect ...
var connectRect = this._connectRect; var connectRect = this._connectRect;
var targetSize = targetTopic.getSize(); 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); connectRect.setSize(width, height);
var targetPosition = targetTopic.getPosition(); var targetPosition = targetTopic.getPosition();

View File

@ -71,7 +71,8 @@ mindplot.DragTopicPositioner = new Class({
// Finally, connect nodes ... // Finally, connect nodes ...
if (!dragTopic.isConnected()) { if (!dragTopic.isConnected()) {
var centalTopic = topics[0]; var centalTopic = topics[0];
if ($defined(mainTopicToMainTopicConnection)) { if ($defined(mainTopicToMainTopicConnection))
{
dragTopic.connectTo(mainTopicToMainTopicConnection); dragTopic.connectTo(mainTopicToMainTopicConnection);
} else if (Math.abs(dragTopic.getPosition().x - centalTopic.getPosition().x) <= mindplot.DragTopicPositioner.CENTRAL_TO_MAINTOPIC_MAX_HORIZONTAL_DISTANCE) { } else if (Math.abs(dragTopic.getPosition().x - centalTopic.getPosition().x) <= mindplot.DragTopicPositioner.CENTRAL_TO_MAINTOPIC_MAX_HORIZONTAL_DISTANCE) {
dragTopic.connectTo(centalTopic); dragTopic.connectTo(centalTopic);
@ -82,7 +83,6 @@ mindplot.DragTopicPositioner = new Class({
_lookUpForMainTopicToMainTopicConnection : function(dragTopic) { _lookUpForMainTopicToMainTopicConnection : function(dragTopic) {
var topics = this._topics; var topics = this._topics;
var result = null; var result = null;
var clouserDistance = -1;
var draggedNode = dragTopic.getDraggedTopic(); var draggedNode = dragTopic.getDraggedTopic();
var distance = null; var distance = null;

View File

@ -220,6 +220,18 @@ mindplot.LocalActionDispatcher = new Class({
this.execute(command); 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) { execute:function(command) {
this._actionRunner.execute(command); this._actionRunner.execute(command);
} }

View File

@ -26,18 +26,11 @@ mindplot.ShirinkConnector = new Class({
elipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH); elipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH);
elipse.addEventListener('click', function(event) { elipse.addEventListener('click', function(event) {
var model = topic.getModel(); var model = topic.getModel();
var isShrink = !model.areChildrenShrinked(); var collapse = !model.areChildrenShrinked();
var actionRunner = mindplot.DesignerActionRunner.getInstance();
var topicId = topic.getId(); var topicId = topic.getId();
var actionDispatcher = mindplot.ActionDispatcher.getInstance();
var commandFunc = function(topic, isShrink) { actionDispatcher.shrinkBranch([topicId],collapse);
topic.setChildrenShrinked(isShrink);
return !isShrink;
};
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, isShrink, [topicId]);
actionRunner.execute(command);
var e = new Event(event).stop(); var e = new Event(event).stop();
e.preventDefault(); e.preventDefault();

View File

@ -12,7 +12,9 @@
<link rel="stylesheet" type="text/css" href="../css/editor.css"/> <link rel="stylesheet" type="text/css" href="../css/editor.css"/>
<link rel="stylesheet" type="text/css" href="../css/bubble.css"/> <link rel="stylesheet" type="text/css" href="../css/bubble.css"/>
<!--<script type='text/javascript' src='http://docs.google.com/brix/static/api/js/jsapi.nocache.js'></script>-->
<!--<script type='text/javascript' src='../js/wiseLibrary.js'></script>--> <!--<script type='text/javascript' src='../js/wiseLibrary.js'></script>-->
<script type='text/javascript' src='../js/mootools-core-1.3.2-full-compat.js'></script> <script type='text/javascript' src='../js/mootools-core-1.3.2-full-compat.js'></script>
<script type='text/javascript' src='../js/mootools-more-1.3.2.1-yui.js'></script> <script type='text/javascript' src='../js/mootools-more-1.3.2.1-yui.js'></script>
@ -25,6 +27,9 @@
<script type='text/javascript' src='../../../../../core-js/target/classes/core.js'></script> <script type='text/javascript' src='../../../../../core-js/target/classes/core.js'></script>
'></script>
<link rel="icon" href="../images/favicon.ico" type="image/x-icon"> <link rel="icon" href="../images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="../images/favicon.ico" type="image/x-icon">
</head> </head>
@ -69,14 +74,10 @@
// @Todo: This must be persited in the map properties ... // @Todo: This must be persited in the map properties ...
var mapId = '1'; var mapId = '1';
var mapXml = '<map name="38298" version="pela"><topic central="true" text="test" id="1"/></map>'; var mapXml = '<map name="38298" version="pela"><topic central="true" text="test" id="1"/></map>';
var editorProperties = {zoom:0.85,saveOnLoad:true}; var editorProperties = {zoom:0.85,saveOnLoad:true};
function printMap() {
document.printForm.mapSvg.value = $("workspaceContainer").innerHTML;
document.printForm.submit();
}
</script> </script>
<div id="colorPalette"> <div id="colorPalette">

View File

@ -391,8 +391,7 @@ function createColorPalette(container, onSelectFunction, event) {
var colorPaletteElement = $("colorPalette"); var colorPaletteElement = $("colorPalette");
colorPaletteElement.setStyle('left', (mouseCoords.x - 80) + "px"); colorPaletteElement.setStyle('left', (mouseCoords.x - 80) + "px");
colorPaletteElement.setStyle('display', "block"); colorPaletteElement.setStyle('display', "block");
} };
;
function cleanScreenEvent() { function cleanScreenEvent() {
if (this.currentColorPicker) { if (this.currentColorPicker) {
@ -435,9 +434,8 @@ function shapeTypePanel() {
function fontSizePanel() { function fontSizePanel() {
var shapeTypePanel = ['small','normal','large','huge']; var shapeTypePanel = ['small','normal','large','huge'];
var map = {small:'6',normal:'8',large:'10',huge:'15'}; var map = {small:'6',normal:'8',large:'10',huge:'15'};
var updateFunction = function(value) { var updateFunction = function(key) {
var nodes = designer.getSelectedNodes(); var value = map[key];
var value = map[value];
designer.setFontSize2SelectedNode(value); designer.setFontSize2SelectedNode(value);
}; };
@ -488,7 +486,6 @@ function buildPanel(buttonElemId, elemLinksContainer, elemLinkIds, updateFunctio
if (!isRendered) { if (!isRendered) {
container.setStyle('left', (mouseCoords.x - 10) + "px"); container.setStyle('left', (mouseCoords.x - 10) + "px");
} }
}); });
var fontOnClick = function(event) { var fontOnClick = function(event) {