mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 15:19:56 +08:00
Fix up bug with the way we hide list items
If we use an #unless condition, then when the view is removed from the template, it is destroyed, and cannot be inserted again. So we’ll just keep the item there the whole time, and toggle its visibility with CSS.
This commit is contained in:
@ -9,9 +9,10 @@ var precompileTemplate = Ember.Handlebars.compile;
|
||||
*/
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'li',
|
||||
classNameBindings: ['hidden'],
|
||||
layout: precompileTemplate('<a href="#" class="btn btn-default btn-more" {{action "toggle"}}>{{fa-icon "ellipsis-h"}}</a>'),
|
||||
|
||||
hideItem: Ember.computed.not('post.isHidden'),
|
||||
hidden: Ember.computed.not('post.isHidden'),
|
||||
|
||||
actions: {
|
||||
toggle: function() {
|
||||
|
Reference in New Issue
Block a user