Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix #2641: Input field change to blank after double click F2 to rename the file - few user will encounter #3299

Merged
merged 5 commits into from
Apr 24, 2013
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/project/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ define(function (require, exports, module) {
* @ see getBaseUrl(), setBaseUrl()
*/
var _projectBaseUrl = "";

/**
* @private
* @type {PreferenceStorage}
Expand Down Expand Up @@ -1272,6 +1272,11 @@ define(function (require, exports, module) {
// First make sure the item in the tree is visible - jsTree's rename API doesn't do anything to ensure inline input is visible
showInTree(entry)
.done(function (selected) {
// Don't try to rename again if we are already renaming
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go at the top of the function, before the call to showInTree(). There is no real harm in calling showInTree(), but it is not necessary since the item will be visible if it is being renamed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if (_isInRename(selected)) {
return;
}

var isFolder = selected.hasClass("jstree-open") || selected.hasClass("jstree-closed");

_projectTree.one("rename.jstree", function (event, data) {
Expand Down