Permalink
Browse files

Merge remote-tracking branch 'origin/nj/issue-84'

  • Loading branch information...
joelrbrandt committed Jan 22, 2012
2 parents 0a3f4df + 22324c0 commit b6e87fa203fa708d5bbfd796d8b870f7fa054e5e
Showing with 16 additions and 11 deletions.
  1. +16 −11 src/ProjectManager.js
View
@@ -26,9 +26,7 @@ define(function(require, exports, module) {
, CommandManager = require("CommandManager")
, Commands = require("Commands")
, Strings = require("strings")
- , EditorManager = require("EditorManager")
, FileViewController = require("FileViewController")
- , DocumentManager = require("DocumentManager")
;
$(FileViewController).on("documentSelectionFocusChange", function(event) {
@@ -578,17 +576,24 @@ define(function(require, exports, module) {
result.resolve();
}
})
- .bind("dblclick.jstree", function(event) {
- var entry = $(event.target).closest("li").data("entry");
- if (entry.isFile){
- FileViewController.addToWorkingSetAndSelect( entry.fullPath);
-
- // jstree dblclick handling seems to steal focus from editor, so set focus again
- EditorManager.focusEditor();
- }
+ // jstree has a default event handler for dblclick that attempts to clear the
+ // global window selection (presumably because it doesn't want text within the tree
+ // to be selected). This ends up messing up CodeMirror, and we don't need this anyway
+ // since we've turned off user selection of UI text globally. So we just unbind it,
+ // and add our own double-click handler here.
+ // Filed this bug against jstree at https://github.com/vakata/jstree/issues/163
+ _projectTree.bind("init.jstree", function() {
+ _projectTree
+ .unbind("dblclick.jstree")
+ .bind("dblclick.jstree", function(event) {
+ var entry = $(event.target).closest("li").data("entry");
+ if (entry.isFile){
+ FileViewController.addToWorkingSetAndSelect(entry.fullPath);
+ }
+ });
});
-
+
return result;
};

0 comments on commit b6e87fa

Please sign in to comment.