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

Commit 30a7028

Browse files
committed
Merge pull request #2802 from WebsiteDeveloper/Issue-2509
Fixed: Issue 2509 Double-clicking in rename input acts like double-clicking file normally
2 parents 73445a5 + 1a2ee47 commit 30a7028

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/project/ProjectManager.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,16 @@ define(function (require, exports, module) {
358358
_redraw(true, false);
359359
}
360360

361+
/**
362+
* Returns false when the event occured without any input present in the li closest to the DOM object
363+
*
364+
* @param {event} event to check
365+
* @return boolean true if an input field is present
366+
*/
367+
function _isInRename(element) {
368+
return ($(element).closest("li").find("input").length > 0);
369+
}
370+
361371
/**
362372
* @private
363373
* Given an input to jsTree's json_data.data setting, display the data in the file tree UI
@@ -534,7 +544,7 @@ define(function (require, exports, module) {
534544
.unbind("dblclick.jstree")
535545
.bind("dblclick.jstree", function (event) {
536546
var entry = $(event.target).closest("li").data("entry");
537-
if (entry && entry.isFile) {
547+
if (entry && entry.isFile && !_isInRename(event.target)) {
538548
FileViewController.addToWorkingSetAndSelect(entry.fullPath);
539549
}
540550
});

0 commit comments

Comments
 (0)