Merge pull request #3629 from tgxworld/ok_lets_fix_open_in_new_tab

FIX: Let users open header links in new tab without dismissing dropdown.
This commit is contained in:
Régis Hanol 2015-07-27 14:41:44 +02:00
commit 326b2812e4
1 changed files with 2 additions and 6 deletions

View File

@ -80,12 +80,8 @@ export default Discourse.View.extend({
}); });
$dropdown.on('click.d-dropdown', function(e) { $dropdown.on('click.d-dropdown', function(e) {
if(e.which === 1 && if(e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) return true;
$(e.target).closest('a').not('.search-link, .filter-type').length > 0) { return $(e.target).closest('a').not('.search-link, .filter-type').length > 0 ? hideDropdown() : true;
return hideDropdown();
} else {
return true;
}
}); });
$html.data('hide-dropdown', hideDropdown); $html.data('hide-dropdown', hideDropdown);