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

Commit

Permalink
Merge pull request #912 from adobe/jason-sanjose/fix-unit-tests
Browse files Browse the repository at this point in the history
check for rename before styling renameInput
  • Loading branch information
redmunds committed May 18, 2012
2 parents 821d7db + a23ce0c commit c9c4f9d
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/project/ProjectManager.js
Expand Up @@ -830,21 +830,23 @@ define(function (require, exports, module) {
// Create the node and open the editor
_projectTree.jstree("create", node, position, {data: initialName}, null, skipRename);

var renameInput = _projectTree.find(".jstree-rename-input");

renameInput.on("keydown", function (event) {
// Listen for escape key on keydown, so we can remove the node in the create.jstree handler above
if (event.keyCode === 27) {
escapeKeyPressed = true;
}
});

// TODO (issue #277): Figure out better way to style this input. All styles are inlined by jsTree...
renameInput.css({ left: "17px", height: "24px"})
.parent().css({ height: "26px"});

// make sure edit box is within the sidebar's view
renameInput.get(0).scrollIntoView();
if (!skipRename) {
var renameInput = _projectTree.find(".jstree-rename-input");

renameInput.on("keydown", function (event) {
// Listen for escape key on keydown, so we can remove the node in the create.jstree handler above
if (event.keyCode === 27) {
escapeKeyPressed = true;
}
});

// TODO (issue #277): Figure out better way to style this input. All styles are inlined by jsTree...
renameInput.css({ left: "17px", height: "24px"})
.parent().css({ height: "26px"});

// make sure edit box is within the sidebar's view
renameInput.get(0).scrollIntoView();
}

return result.promise();
}
Expand Down

0 comments on commit c9c4f9d

Please sign in to comment.