Skip to content
Snippets Groups Projects
Commit b66f4475 authored by Stefan's avatar Stefan Committed by Stefan Galinski
Browse files

[BUGFIX] Pagetree - Selection state incorrect after a cancelled edit

Currently the selection state of a node is set to the wrong node if you cancel an inline edit.

Change-Id: I2d0af2a4e37c975ef7885ee3cc4ea872d5a405bc
Resolves: #M17828
Reviewed-on: http://review.typo3.org/979


Reviewed-by: default avatarStefan Galinski <stefan.galinski@gmail.com>
Tested-by: default avatarStefan Galinski <stefan.galinski@gmail.com>
parent ef5aa041
No related merge requests found
......@@ -689,6 +689,8 @@ TYPO3.Components.PageTree.Actions = {
* @return {void}
*/
singleClick: function(node, tree) {
tree.currentSelectedNode = node;
var separator = '?';
if (currentSubScript.indexOf('?') !== -1) {
separator = '&';
......
......@@ -56,6 +56,13 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
*/
treeEditor: null,
/**
* Currently Selected Node
*
* @type {Ext.tree.TreeNode}
*/
currentSelectedNode: null,
/**
* Enable the drag and drop feature
*
......
......@@ -41,7 +41,7 @@ TYPO3.Components.PageTree.TreeEditor = Ext.extend(Ext.tree.TreeEditor, {
*
* @type {Boolean}
*/
ignoreNoChange: true,
ignoreNoChange: false,
/**
* Edit delay
......@@ -74,7 +74,12 @@ TYPO3.Components.PageTree.TreeEditor = Ext.extend(Ext.tree.TreeEditor, {
complete: {
fn: function(node, newValue, oldValue) {
this.editNode.ownerTree.commandProvider.saveTitle(node, this.updatedValue, oldValue, this);
if (newValue === oldValue) {
this.fireEvent('canceledit', this);
return false;
}
this.editNode.getOwnerTree().commandProvider.saveTitle(node, this.updatedValue, oldValue, this);
}
},
......@@ -82,6 +87,13 @@ TYPO3.Components.PageTree.TreeEditor = Ext.extend(Ext.tree.TreeEditor, {
fn: function(element, value) {
this.field.selectText();
}
},
canceledit: function() {
var tree = this.editNode.getOwnerTree();
if (tree.currentSelectedNode) {
tree.currentSelectedNode.select();
}
}
},
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment