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

Conversation

TomMalbran
Copy link
Contributor

This adds a renaming flag, so that when F2 is pressed for the second time, the code does nothing, leaving the renaming as it was, which fixes issue #2641.

@ghost ghost assigned njx and gruehle Apr 1, 2013
@julianasuh
Copy link
Contributor

Assigned @gruehle

@peterflynn
Copy link
Member

Would it be better to just check ProjectManager._isInRename()?

@TomMalbran
Copy link
Contributor Author

I didn't saw that function before. It should work to fix this too.

@@ -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

@gruehle
Copy link
Member

gruehle commented Apr 23, 2013

Initial review complete. It works as advertised, but the _isInRename() check could be done earlier.

@@ -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.

@gruehle
Copy link
Member

gruehle commented Apr 24, 2013

Thanks! Merging.

gruehle added a commit that referenced this pull request Apr 24, 2013
Fix #2641: Input field change to blank after double click F2 to rename the file - few user will encounter
@gruehle gruehle merged commit c449c12 into adobe:master Apr 24, 2013
@TomMalbran TomMalbran deleted the tom/fix-issue-2641 branch July 23, 2013 08:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants