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 4 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 @@ -1302,6 +1302,11 @@ define(function (require, exports, module) {
* @param {!Entry} entry FileEntry or DirectoryEntry to rename
*/
function renameItemInline(entry) {
// Don't try to rename again if we are already renaming
if (_isInRename(entry)) {
Copy link
Member

Choose a reason for hiding this comment

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

The _isInRename() function is expecting a DOM element, but entry is a FileEntry. You'll need to get the selected DOM element here.

It may just be easiest to put the code back where it was... Sorry about that! :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. It's ok. I did a fast test and it worked, so I submitted the change, but I might have been using the old version even after reloading the second window.

return;
}

// 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) {
Expand Down