From ad5cefeefc2dec285f9f9bb177e5bd190d0e6996 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 22 Mar 2013 19:06:14 +0100 Subject: Better fix for IE9 issue with document.activeElement error (#1489008) --- program/js/app.js | 5 +++++ program/js/common.js | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 1d77e056e..32328358a 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -178,6 +178,11 @@ function rcube_webmail() parent.rcmail.env.frame_lock = null; } + // Makes that reference to document.activeElement do not throw + // "unspecified error" in IE9 (#1489008) + if (this.env.framed && bw.ie) + document.documentElement.focus(); + // enable general commands this.enable_command('close', 'logout', 'mail', 'addressbook', 'settings', 'save-pref', 'compose', 'undo', 'about', 'switch-task', true); diff --git a/program/js/common.js b/program/js/common.js index 7ad1891ec..1075225b4 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -743,12 +743,8 @@ jQuery.fn.placeholder = function(text) { }); // Do not blur currently focused element - // Catch "unspecified error" in IE9 (#1489008) - try { - if (this != document.activeElement) - elem.blur(); - } - catch(e) {} + if (this != document.activeElement) + elem.blur(); } }); }; -- cgit v1.2.3