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:
Toby Zerner
2015-02-10 19:55:22 +10:30
parent 090e8c6061
commit ffef6af403
3 changed files with 10 additions and 10 deletions

View File

@ -9,8 +9,9 @@ var precompileTemplate = Ember.Handlebars.compile;
hover which details who edited the post and when.
*/
export default Ember.Component.extend({
tagName: 'span',
tagName: 'li',
classNames: ['post-edited'],
classNameBindings: ['hidden'],
attributeBindings: ['title'],
layout: precompileTemplate('{{fa-icon "pencil"}}'),
@ -20,7 +21,7 @@ export default Ember.Component.extend({
// In the context of an item list, this item will be hidden if the post
// hasn't been edited, or if it's been hidden.
hideItem: Ember.computed('post.isEdited', 'post.isHidden', function() {
hidden: Ember.computed('post.isEdited', 'post.isHidden', function() {
return !this.get('post.isEdited') || this.get('post.isHidden');
}),