mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Updating the category was not updating the UI
This commit is contained in:
@@ -40,18 +40,18 @@ const Topic = RestModel.extend({
|
||||
return ({ type: 'topic', id: this.get('id') });
|
||||
}.property('id'),
|
||||
|
||||
category: function() {
|
||||
const categoryId = this.get('category_id');
|
||||
if (categoryId) {
|
||||
return Discourse.Category.list().findProperty('id', categoryId);
|
||||
}
|
||||
_categoryIdChanged: function() {
|
||||
this.set('category', Discourse.Category.findById(this.get('category_id')));
|
||||
}.observes('category_id').on('init'),
|
||||
|
||||
_categoryNameChanged: function() {
|
||||
const categoryName = this.get('categoryName');
|
||||
let category;
|
||||
if (categoryName) {
|
||||
return Discourse.Category.list().findProperty('name', categoryName);
|
||||
category = Discourse.Category.list().findProperty('name', categoryName);
|
||||
}
|
||||
return null;
|
||||
}.property('category_id', 'categoryName'),
|
||||
this.set('category', category);
|
||||
}.observes('categoryName'),
|
||||
|
||||
categoryClass: function() {
|
||||
return 'category-' + this.get('category.fullSlug');
|
||||
@@ -407,7 +407,6 @@ Topic.reopenClass({
|
||||
// The title can be cleaned up server side
|
||||
props.title = result.basic_topic.title;
|
||||
props.fancy_title = result.basic_topic.fancy_title;
|
||||
|
||||
topic.setProperties(props);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
{{plugin-outlet "edit-topic"}}
|
||||
|
||||
{{d-button action="finishedEditingTopic" class="btn-primary btn-small no-text" icon="check"}}
|
||||
{{d-button action="cancelEditingTopic" class="btn-small no-text" icon="times"}}
|
||||
{{d-button action="finishedEditingTopic" class="btn-primary btn-small no-text submit-edit" icon="check"}}
|
||||
{{d-button action="cancelEditingTopic" class="btn-small no-text cancel-edit" icon="times"}}
|
||||
{{else}}
|
||||
<h1>
|
||||
{{#unless is_warning}}
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
{{#if details.loaded}}
|
||||
{{topic-status topic=model}}
|
||||
<a href='{{unbound url}}' {{action "jumpTop"}}>
|
||||
<a href='{{unbound url}}' {{action "jumpTop"}} class='fancy-title'>
|
||||
{{{fancy_title}}}
|
||||
</a>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user