Strange behavior when renaming pages in the pagetree
Steps to reproduce:
- Edit a page by using double click on the pagename, enter a new pagename
- do NOT! press Enter
- double click on another page in the tree (while the first input field is still active)
Now you should see two errors:
- If you just press ENTER in the next page without renaming it, it will get the name of the previously edited page
- When you double click on on the first page again, you will see its old name in the input field until you reload the pagetree.
[BUGFIX] Change name of correct pagetree entry after renaming
- The first parameter to TreeEditor.complete and
TreeEditor.beforecomplete is the TreeEditor, not the edited node.
Reflect this in the code.
- In TreeEditor.updateNodeText, update the node provided as parameter
instead of the current editNode.
- In saveTitle, remove the first parameter, because it's used in the
wrong way (code assumes i'ts a node, but it's actually a TreeEditor) and
is not necessary.
- In saveTitle, store the current editNode, in case treeEditor.editNode
changes before the ajax call completes.
Reviewed-by: Daniel Goerz <email@example.com>
Tested-by: Daniel Goerz <firstname.lastname@example.org>
Reviewed-by: Michael Oehlhof <email@example.com>
Tested-by: Michael Oehlhof <firstname.lastname@example.org>
Reviewed-by: Andreas Fernandez <email@example.com>
Tested-by: Andreas Fernandez <firstname.lastname@example.org>