2015-02-10 15:35:40 +08:00
|
|
|
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',
|
2015-02-10 17:25:22 +08:00
|
|
|
classNameBindings: ['hidden'],
|
2015-02-10 15:35:40 +08:00
|
|
|
layout: precompileTemplate('<a href="#" class="btn btn-default btn-more" {{action "toggle"}}>{{fa-icon "ellipsis-h"}}</a>'),
|
|
|
|
|
2015-02-10 17:25:22 +08:00
|
|
|
hidden: Ember.computed.not('post.isHidden'),
|
2015-02-10 15:35:40 +08:00
|
|
|
|
|
|
|
actions: {
|
|
|
|
toggle: function() {
|
|
|
|
this.toggleProperty('parent.revealContent');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|