From 9fbe0050dfc025bfa18bdb1455f7332b785d1baa Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Thu, 25 Aug 2011 00:17:13 -0300 Subject: [PATCH] - Fix f2. - Reduce timeout. --- mindplot/src/main/javascript/DesignerKeyboard.js | 7 +++---- mindplot/src/main/javascript/IconGroup.js | 2 +- mindplot/src/main/javascript/MindmapDesigner.js | 9 ++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index 0ba53f61..1bd803cf 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -47,8 +47,7 @@ mindplot.DesignerKeyboard = new Class({ 'f2' : function() { var node = this._getSelectedNode(designer); if (node) { - var topic = nodes[0]; - topic.showTextEditor(); + node.showTextEditor(); } }.bind(this), @@ -197,7 +196,7 @@ mindplot.DesignerKeyboard = new Class({ var regex = /^(?:shift|control|ctrl|alt|meta)$/; var modifiers = ['shift', 'control', 'alt', 'meta']; - var excludes = ['esc','capslock','tab','f3','f4','f5','f6','f7','f8','f9','10','11','12']; + var excludes = ['esc','capslock','tab','f1','f3','f4','f5','f6','f7','f8','f9','f10','f11','f12']; $(document).addEvent('keydown', function(event) { @@ -324,7 +323,7 @@ mindplot.DesignerKeyboard = new Class({ }, _getSelectedNode : function(designer) { - var nodes = designer.filterSelectedTopics(); + var nodes = designer.getModel().filterSelectedTopics(); return (nodes.length > 0) ? nodes[0] : null; } }); diff --git a/mindplot/src/main/javascript/IconGroup.js b/mindplot/src/main/javascript/IconGroup.js index 96558bef..5e11e382 100644 --- a/mindplot/src/main/javascript/IconGroup.js +++ b/mindplot/src/main/javascript/IconGroup.js @@ -245,7 +245,7 @@ mindplot.IconGroup.RemoveTip = new Class({ }, hide : function() { - this.close(500); + this.close(200); }, close : function(delay) { diff --git a/mindplot/src/main/javascript/MindmapDesigner.js b/mindplot/src/main/javascript/MindmapDesigner.js index 81fb3da9..dc9b6775 100644 --- a/mindplot/src/main/javascript/MindmapDesigner.js +++ b/mindplot/src/main/javascript/MindmapDesigner.js @@ -298,8 +298,7 @@ mindplot.MindmapDesigner = new Class({ this._actionDispatcher.addTopic(siblingModel, parentTopicId, true); } - } - , + }, addRelationShip : function(event) { var screen = this._workspace.getScreenManager(); @@ -612,15 +611,15 @@ mindplot.MindmapDesigner = new Class({ deleteCurrentNode : function() { - var validateFunc = function(selectedObject) { - return selectedObject.getType() == mindplot.RelationshipLine.type || selectedObject.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE + var validateFunc = function(object) { + return object.getType() == mindplot.RelationshipLine.type || object.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE }; var validateError = 'Central topic can not be deleted.'; var model = this.getModel(); var topics = model.filterTopicsIds(validateFunc, validateError); var rel = model.filterRelationIds(validateFunc, validateError); - if (objects.length > 0) { + if (topics.length > 0 || rel.length > 0) { this._actionDispatcher.deleteTopics({'nodes':topics,'relationship':rel}); }