mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: Missing colspan
on raw topic list
This commit is contained in:
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
@ -22,6 +22,8 @@
|
|||||||
RawHandlebars.helpers.get = function(context, options){
|
RawHandlebars.helpers.get = function(context, options){
|
||||||
var firstContext = options.contexts[0];
|
var firstContext = options.contexts[0];
|
||||||
var val = firstContext[context];
|
var val = firstContext[context];
|
||||||
|
|
||||||
|
if (val && val.isDescriptor) { return Em.get(firstContext, context); }
|
||||||
val = val === undefined ? Em.get(firstContext, context): val;
|
val = val === undefined ? Em.get(firstContext, context): val;
|
||||||
return val;
|
return val;
|
||||||
};
|
};
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<input type="checkbox" class="bulk-select">
|
<input type="checkbox" class="bulk-select">
|
||||||
</td>
|
</td>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<td class='main-link clearfix' colspan="{{titleColSpan}}">
|
<td class='main-link clearfix' colspan="{{titleColSpan}}">
|
||||||
{{raw "topic-status" topic=topic}}
|
{{raw "topic-status" topic=topic}}
|
||||||
{{topic-link topic}}
|
{{topic-link topic}}
|
@ -4,7 +4,7 @@ export default Discourse.View.extend(StringBuffer, {
|
|||||||
topic: Em.computed.alias("content"),
|
topic: Em.computed.alias("content"),
|
||||||
rerenderTriggers: ['controller.bulkSelectEnabled', 'topic.pinned'],
|
rerenderTriggers: ['controller.bulkSelectEnabled', 'topic.pinned'],
|
||||||
tagName: 'tr',
|
tagName: 'tr',
|
||||||
rawTemplate: 'list/topic_list_item.raw',
|
rawTemplate: 'list/topic-list-item.raw',
|
||||||
classNameBindings: ['controller.checked',
|
classNameBindings: ['controller.checked',
|
||||||
':topic-list-item',
|
':topic-list-item',
|
||||||
'unboundClassNames',
|
'unboundClassNames',
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
//= require jquery.debug
|
//= require jquery.debug
|
||||||
//= require jquery.ui.widget
|
//= require jquery.ui.widget
|
||||||
//= require handlebars
|
//= require handlebars
|
||||||
//= require ember.debug
|
//= require ember.custom.debug
|
||||||
//= require message-bus
|
//= require message-bus
|
||||||
//= require ember-qunit
|
//= require ember-qunit
|
||||||
//= require fake_xml_http_request
|
//= require fake_xml_http_request
|
||||||
|
Reference in New Issue
Block a user