Merge pull request #3571 from tgxworld/fix_header_not_dismissing_on_click

UX: Dropdown not dismissing until next page renders.
This commit is contained in:
Sam 2015-07-09 11:49:58 +10:00
commit 160ee67620
2 changed files with 9 additions and 1 deletions

View File

@ -60,6 +60,7 @@ export default Discourse.View.extend({
controller.set('visibleDropdown', null);
}
$html.off('click.d-dropdown');
$dropdown.off('click.d-dropdown');
};
// if a dropdown is active and the user clicks on it, close it
@ -78,6 +79,10 @@ export default Discourse.View.extend({
return $(e.target).closest('.d-dropdown').length > 0 ? true : hideDropdown.apply(self);
});
$dropdown.on('click.d-dropdown', function(e) {
return $(e.target).closest('a').not('.search-link').length > 0 ? hideDropdown.apply(self) : true;
});
$html.data('hide-dropdown', hideDropdown);
return false;

View File

@ -238,7 +238,10 @@
&#site-map-dropdown {
.heading {
padding: 5px 5px 5px 0;
a {padding: 0 5px;}
a {
display: block;
padding: 0 5px;
}
}
}