diff --git a/app/assets/javascripts/discourse/controllers/topic-list-item.js.es6 b/app/assets/javascripts/discourse/controllers/topic-list-item.js.es6 deleted file mode 100644 index 073180ea783..00000000000 --- a/app/assets/javascripts/discourse/controllers/topic-list-item.js.es6 +++ /dev/null @@ -1,40 +0,0 @@ -import ObjectController from 'discourse/controllers/object'; - -// Handles displaying of a topic as a list item -export default ObjectController.extend({ - needs: ['discovery/topics'], - - canStar: Em.computed.alias('controllers.discovery/topics.currentUser.id'), - bulkSelectEnabled: Em.computed.alias('controllers.discovery/topics.bulkSelectEnabled'), - showTopicPostBadges: Em.computed.not('controllers.discovery/topics.new'), - - checked: function(key, value) { - var selected = this.get('controllers.discovery/topics.selected'), - topic = this.get('model'); - - if (arguments.length > 1) { - if (value) { - selected.addObject(topic); - } else { - selected.removeObject(topic); - } - } - return selected.contains(topic); - }.property('controllers.discovery/topics.selected.length'), - - titleColSpan: function() { - // Uncategorized pinned topics will span the title and category column in the topic list. - return (!this.get('controllers.discovery/topics.hideCategory') && - this.get('model.isPinnedUncategorized') ? 2 : 1); - }.property('controllers.discovery/topics.hideCategory', 'model.isPinnedUncategorized'), - - hideCategory: function() { - return this.get('controllers.discovery/topics.hideCategory') || this.get('titleColSpan') > 1; - }.property('controllers.discovery/topics.hideCategory', 'titleColSpan'), - - actions: { - toggleStar: function() { - this.get('model').toggleStar(); - } - } -}); diff --git a/app/assets/javascripts/discourse/lib/ember_compat_handlebars.js b/app/assets/javascripts/discourse/lib/ember_compat_handlebars.js index 293dcfcf5b2..d6e85b19a7f 100644 --- a/app/assets/javascripts/discourse/lib/ember_compat_handlebars.js +++ b/app/assets/javascripts/discourse/lib/ember_compat_handlebars.js @@ -22,6 +22,8 @@ RawHandlebars.helpers.get = function(context, options){ var firstContext = options.contexts[0]; var val = firstContext[context]; + + if (val && val.isDescriptor) { return Em.get(firstContext, context); } val = val === undefined ? Em.get(firstContext, context): val; return val; }; diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs b/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs similarity index 99% rename from app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs rename to app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs index 9ec92ec1df8..92f0bd68e9b 100644 --- a/app/assets/javascripts/discourse/templates/list/topic_list_item.raw.hbs +++ b/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs @@ -3,6 +3,7 @@ {{/if}} +