mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
Merge pull request #3626 from tgxworld/fix_dropdown_dismissing_on_middle_click
FIX: Dropdown dismissing on middle click.
This commit is contained in:
commit
172b7bbb85
@ -76,11 +76,16 @@ export default Discourse.View.extend({
|
||||
$dropdown.find('input[type=text]').focus().select();
|
||||
|
||||
$html.on('click.d-dropdown', function(e) {
|
||||
return $(e.target).closest('.d-dropdown').length > 0 ? true : hideDropdown.apply(self);
|
||||
return $(e.target).closest('.d-dropdown').length > 0 ? true : hideDropdown();
|
||||
});
|
||||
|
||||
$dropdown.on('click.d-dropdown', function(e) {
|
||||
return $(e.target).closest('a').not('.search-link, .filter-type').length > 0 ? hideDropdown.apply(self) : true;
|
||||
if(e.which === 1 &&
|
||||
$(e.target).closest('a').not('.search-link, .filter-type').length > 0) {
|
||||
return hideDropdown();
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
$html.data('hide-dropdown', hideDropdown);
|
||||
|
Loading…
Reference in New Issue
Block a user