Keep post actions visible when controls dropdown is open

Also show without hover on touch devices
This commit is contained in:
Toby Zerner
2015-09-22 17:05:14 +09:30
parent 8ab0686666
commit d610ea663f
4 changed files with 31 additions and 6 deletions

View File

@ -14,6 +14,7 @@ import listItems from 'flarum/helpers/listItems';
* - `caretIcon` The name of an icon to show on the right of the button.
* - `label` The label of the dropdown toggle button. Defaults to 'Controls'.
* - `onhide`
* - `onshow`
*
* The children will be displayed as a list inside of the dropdown menu.
*/
@ -52,9 +53,14 @@ export default class Dropdown extends Component {
'Dropdown-menu--top',
$menu.offset().top + $menu.height() > $(window).scrollTop() + $(window).height()
);
if (this.props.onshow) {
this.props.onshow();
m.redraw();
}
});
this.$().on('hide.bs.dropdown', () => {
this.$().on('hidden.bs.dropdown', () => {
if (this.props.onhide) {
this.props.onhide();
m.redraw();