From 59de8b0ff4ea4f5545a025673f05df95cd221c16 Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 25 Jan 2013 17:52:23 +0400 Subject: [PATCH] fix loading editor in iframe on ie9 --- lib/ace/keyboard/textinput.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 183260c9..3ad20179 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -63,7 +63,9 @@ var TextInput = function(parentNode, host) { var isSelectionEmpty = true; // FOCUS - var isFocused = document.activeElement === text; + // ie9 throws error if document.activeElement is accessed too soon + try { var isFocused = document.activeElement === text; } catch(e) {} + event.addListener(text, "blur", function() { host.onBlur(); isFocused = false;