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 #2802 from WebsiteDeveloper/Issue-2509
Browse files Browse the repository at this point in the history
Fixed: Issue 2509 Double-clicking in rename input acts like double-clicking file normally
  • Loading branch information
redmunds committed Feb 8, 2013
2 parents 73445a5 + 1a2ee47 commit 30a7028
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/project/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,16 @@ define(function (require, exports, module) {
_redraw(true, false);
}

/**
* Returns false when the event occured without any input present in the li closest to the DOM object
*
* @param {event} event to check
* @return boolean true if an input field is present
*/
function _isInRename(element) {
return ($(element).closest("li").find("input").length > 0);
}

/**
* @private
* Given an input to jsTree's json_data.data setting, display the data in the file tree UI
Expand Down Expand Up @@ -534,7 +544,7 @@ define(function (require, exports, module) {
.unbind("dblclick.jstree")
.bind("dblclick.jstree", function (event) {
var entry = $(event.target).closest("li").data("entry");
if (entry && entry.isFile) {
if (entry && entry.isFile && !_isInRename(event.target)) {
FileViewController.addToWorkingSetAndSelect(entry.fullPath);
}
});
Expand Down

0 comments on commit 30a7028

Please sign in to comment.