FIX: Select topic timer's category by default in edit modal.

This commit is contained in:
Guo Xiang Tan 2017-07-06 16:01:57 +09:00
parent c53eeaaa68
commit f6491ee125
3 changed files with 7 additions and 4 deletions

View File

@ -42,7 +42,7 @@ export default Combobox.extend({
@computed("rootNone", "rootNoneLabel") @computed("rootNone", "rootNoneLabel")
none(rootNone, rootNoneLabel) { none(rootNone, rootNoneLabel) {
if (Discourse.SiteSettings.allow_uncategorized_topics || this.get('allowUncategorized')) { if (this.siteSettings.allow_uncategorized_topics || this.get('allowUncategorized')) {
if (rootNone) { if (rootNone) {
return rootNoneLabel || "category.none"; return rootNoneLabel || "category.none";
} else { } else {

View File

@ -70,7 +70,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
time, time,
this.get('topicTimer.based_on_last_post'), this.get('topicTimer.based_on_last_post'),
statusType, statusType,
this.get('categoryId') this.get('topicTimer.category_id')
).then(result => { ).then(result => {
if (time) { if (time) {
this.send('closeModal'); this.send('closeModal');

View File

@ -13,13 +13,16 @@
{{else if publishToCategory}} {{else if publishToCategory}}
<div class="control-group"> <div class="control-group">
<label>{{i18n 'topic.topic_status_update.publish_to'}}</label> <label>{{i18n 'topic.topic_status_update.publish_to'}}</label>
{{category-chooser valueAttribute="id" value=categoryId excludeCategoryId=excludeCategoryId}} {{category-chooser
valueAttribute="id"
value=topicTimer.category_id
excludeCategoryId=excludeCategoryId}}
</div> </div>
{{auto-update-input {{auto-update-input
input=updateTime input=updateTime
statusType=selection statusType=selection
categoryId=categoryId categoryId=topicTimer.category_id
basedOnLastPost=false}} basedOnLastPost=false}}
{{else if autoClose}} {{else if autoClose}}
{{auto-update-input {{auto-update-input