mirror of
https://github.com/flarum/framework.git
synced 2025-01-10 21:35:38 +08:00
22 lines
590 B
JavaScript
22 lines
590 B
JavaScript
|
import Ember from 'ember';
|
||
|
|
||
|
var precompileTemplate = Ember.Handlebars.compile;
|
||
|
|
||
|
/**
|
||
|
Component for the toggle button in a post header. Toggles the
|
||
|
`parent.revealContent` property when clicked. Only displays if the supplied
|
||
|
post is not hidden.
|
||
|
*/
|
||
|
export default Ember.Component.extend({
|
||
|
tagName: 'li',
|
||
|
layout: precompileTemplate('<a href="#" class="btn btn-default btn-more" {{action "toggle"}}>{{fa-icon "ellipsis-h"}}</a>'),
|
||
|
|
||
|
hideItem: Ember.computed.not('post.isHidden'),
|
||
|
|
||
|
actions: {
|
||
|
toggle: function() {
|
||
|
this.toggleProperty('parent.revealContent');
|
||
|
}
|
||
|
}
|
||
|
});
|