Fix collapse using keybard.

This commit is contained in:
Paulo Gustavo Veiga 2012-07-02 22:54:59 -03:00
parent 1df9afda1b
commit 31c86d053d
8 changed files with 71 additions and 50 deletions

View File

@ -351,6 +351,27 @@ mindplot.Designer = new Class({
return this._model;
},
shrinkSelectedBranch:function () {
var nodes = this.getModel().filterSelectedTopics();
if (nodes.length <= 0) {
// If there are more than one node selected,
$notify($msg('ONE_TOPIC_MUST_BE_SELECTED'));
return;
}
if (nodes.length != 1) {
// If there are more than one node selected,
$notify($msg('ONLY_ONE_TOPIC_MUST_BE_SELECTED'));
return;
}
// Execute event ...
var topic = nodes[0];
this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken());
},
createChildForSelectedNode:function () {
var nodes = this.getModel().filterSelectedTopics();
if (nodes.length <= 0) {

View File

@ -49,12 +49,7 @@ mindplot.DesignerKeyboard = new Class({
}.bind(this),
'space':function () {
var node = model.selectedTopic();
if (node) {
var model = topic.getModel();
var isShrink = !model.areChildrenShrunken();
topic.setChildrenShrunken(isShrink);
}
designer.shrinkSelectedBranch();
}.bind(this),
'f2':function () {
@ -68,8 +63,7 @@ mindplot.DesignerKeyboard = new Class({
designer.deleteCurrentNode();
}.bind(this),
'enter' :
function() {
'enter':function () {
designer.createSiblingForSelectedNode();
}.bind(this),

View File

@ -624,7 +624,6 @@ mindplot.Topic = new Class({
model.setChildrenShrunken(value);
// Change render base on the state.
var shrinkConnector = this.getShrinkConnector();
if ($defined(shrinkConnector)) {
shrinkConnector.changeRender(value);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -202,4 +202,5 @@ SAVE_CHANGES=Save Chages
CHANGE_TEXT_ITALIC=Change Text Italic
DESELECT_ALL_TOPIC=Deselect All Topic
SHORTCUTS=Shortcuts
COLLAPSE_CHILDREN=Collapse Children

View File

@ -203,4 +203,5 @@ SAVE_CHANGES=Guardar los Cambios
CHANGE_TEXT_ITALIC=Cambiar Texto a Italica
DESELECT_ALL_TOPIC=Revertir Selecci\u00f3n de T\u00f3picos
SHORTCUTS=Shortcuts
COLLAPSE_CHILDREN=Colapsar Hijos

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -63,6 +63,11 @@
<td><spring:message code="JUST_START_TYPING"/> | F2</td>
<td><spring:message code="JUST_START_TYPING"/> | F2</td>
</tr>
<tr>
<td><spring:message code="COLLAPSE_CHILDREN"/></td>
<td>Space bar</td>
<td>Space bar</td>
</tr>
<tr>
<td><spring:message code="TOPIC_NAVIGATION"/></td>
<td><spring:message code="ARROW_KEYS"/></td>