mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Change category by editing first post updates topic title
This commit is contained in:
parent
4f0713b9da
commit
361f158b27
2 changed files with 4 additions and 2 deletions
|
@ -392,10 +392,12 @@ Discourse.Composer = Discourse.Model.extend({
|
|||
// Update the title if we've changed it
|
||||
if (this.get('title') && post.get('post_number') === 1) {
|
||||
var topic = this.get('topic');
|
||||
var category = Discourse.Category.list().findProperty('name', this.get('categoryName'));
|
||||
topic.setProperties({
|
||||
title: this.get('title'),
|
||||
fancy_title: this.get('title'),
|
||||
categoryName: this.get('categoryName')
|
||||
categoryName: category.get('name'),
|
||||
category_id: category.get('id')
|
||||
});
|
||||
topic.save();
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
{{topicStatus topic=model}}
|
||||
<a href='{{unbound url}}'>{{{fancy_title}}}</a>
|
||||
{{/if}}
|
||||
{{categoryLink category}}
|
||||
{{boundCategoryLink category}}
|
||||
|
||||
{{#if details.can_edit}}
|
||||
<a href='#' {{action editTopic}} class='edit-topic' title='{{i18n edit}}'><i class="icon-pencil"></i></a>
|
||||
|
|
Loading…
Reference in a new issue