1
0
mirror of https://github.com/flarum/core.git synced 2025-07-28 12:10:51 +02:00

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

@@ -31,7 +31,8 @@ export default class Post extends Component {
() => {
const user = this.props.post.user();
return user && user.freshness;
}
},
() => this.controlsOpen
);
}
@@ -56,7 +57,9 @@ export default class Post extends Component {
className="Post-controls"
buttonClassName="Button Button--icon Button--flat"
menuClassName="Dropdown-menu--right"
icon="ellipsis-h">
icon="ellipsis-h"
onshow={() => this.$('.Post-actions').addClass('open')}
onhide={() => this.$('.Post-actions').removeClass('open')}>
{controls}
</Dropdown>
</li> : ''}
@@ -70,6 +73,13 @@ export default class Post extends Component {
);
}
config(isInitialized, context) {
const $actions = this.$('.Post-actions');
const $controls = this.$('.Post-controls');
$actions.toggleClass('open', $controls.hasClass('open'));
}
/**
* Get attributes for the post element.
*