From bf7eba22535aed74e4fff3d60aeafff8ada39b1c Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 14 Nov 2014 01:27:59 +0400 Subject: [PATCH] fix focusing window with click on ie --- lib/ace/mouse/mouse_handler.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ace/mouse/mouse_handler.js b/lib/ace/mouse/mouse_handler.js index d032e687..6b331eee 100644 --- a/lib/ace/mouse/mouse_handler.js +++ b/lib/ace/mouse/mouse_handler.js @@ -48,6 +48,10 @@ var MouseHandler = function(editor) { new DragdropHandler(this); var focusEditor = function(e) { + // because we have to call event.preventDefault() any window on ie and iframes + // on other browsers do not get focus, so we have to call window.focus() here + if (!document.hasFocus || !document.hasFocus()) + window.focus(); editor.focus(); };