diff --git a/src/project/ProjectManager.js b/src/project/ProjectManager.js index 2667a237414..200d0ad0e55 100644 --- a/src/project/ProjectManager.js +++ b/src/project/ProjectManager.js @@ -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 @@ -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); } });