From 5be258ded4cc201d80383b7b9a574f8e922a4a42 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 27 Jul 2015 19:08:39 +0800 Subject: [PATCH] FIX: Let users open header links in new tab without dismissing dropdown. --- app/assets/javascripts/discourse/views/header.js.es6 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/views/header.js.es6 b/app/assets/javascripts/discourse/views/header.js.es6 index 125e6de38e5..906c479fe43 100644 --- a/app/assets/javascripts/discourse/views/header.js.es6 +++ b/app/assets/javascripts/discourse/views/header.js.es6 @@ -80,12 +80,8 @@ export default Discourse.View.extend({ }); $dropdown.on('click.d-dropdown', function(e) { - if(e.which === 1 && - $(e.target).closest('a').not('.search-link, .filter-type').length > 0) { - return hideDropdown(); - } else { - return true; - } + if(e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) return true; + return $(e.target).closest('a').not('.search-link, .filter-type').length > 0 ? hideDropdown() : true; }); $html.data('hide-dropdown', hideDropdown);