From cfeae239a89e1efd27f5ea8d497d07abb97e003c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Thu, 3 Jul 2014 22:26:11 +0200 Subject: [PATCH] BUGFIX: calling .blur() on the body element unfocus the browser window in IE10 --- app/assets/javascripts/discourse/routes/discourse_route.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/routes/discourse_route.js b/app/assets/javascripts/discourse/routes/discourse_route.js index 33c2ea6ef72..41062fa152c 100644 --- a/app/assets/javascripts/discourse/routes/discourse_route.js +++ b/app/assets/javascripts/discourse/routes/discourse_route.js @@ -54,7 +54,9 @@ Discourse.Route.reopenClass({ if ($.magnificPopup && $.magnificPopup.instance) { $.magnificPopup.instance.close(); } // Remove any link focus - $(document.activeElement).blur(); + // NOTE: the '.not("body")' is here to prevent a bug in IE10 on Win7 + // cf. https://stackoverflow.com/questions/5657371/ie9-window-loses-focus-due-to-jquery-mobile + $(document.activeElement).not("body").blur(); Discourse.set('notifyCount',0); $('#discourse-modal').modal('hide');