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

Fixed: Issue 2509 Double-clicking in rename input acts like double-clicking file normally #2802

Merged
merged 2 commits into from
Feb 8, 2013
Merged
Changes from all 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
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