Skip to content

A platform for community discussion. Free, open, simple.

FIX: don't search for tags when editing topic title

Régis Hanol56be4bb8f07b
diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6
index 25a635b48bf..7a7996e6273 100644
--- a/app/assets/javascripts/discourse/controllers/topic.js.es6
+++ b/app/assets/javascripts/discourse/controllers/topic.js.es6
@@ -238,6 +238,10 @@ export default Ember.Controller.extend(bufferedProperty("model"), {
this.set("buffered.category_id", selection.value);
},
+ topicTagsChanged({ target }) {
+ this.set("buffered.tags", target.value);
+ },
+
deletePending(pending) {
return ajax(`/review/${pending.id}`, { type: "DELETE" })
.then(() => {
diff --git a/app/assets/javascripts/discourse/templates/topic.hbs b/app/assets/javascripts/discourse/templates/topic.hbs
index c10ec5d1175..e5625d000ea 100644
--- a/app/assets/javascripts/discourse/templates/topic.hbs
+++ b/app/assets/javascripts/discourse/templates/topic.hbs
@@ -24,6 +24,7 @@
<span class="private-message-glyph">{{d-icon "envelope"}}</span>
{{/if}}
{{text-field id="edit-title" value=buffered.title maxlength=siteSettings.max_topic_title_length autofocus="true"}}
+
{{#if showCategoryChooser}}
{{category-chooser
class="small"
@@ -32,10 +33,15 @@
{{/if}}
{{#if canEditTags}}
- {{mini-tag-chooser filterable=true tags=buffered.tags categoryId=buffered.category_id}}
+ {{mini-tag-chooser
+ filterable=true
+ tags=(unbound buffered.tags)
+ categoryId=(unbound buffered.category_id)
+ onChangeTags=(action "topicTagsChanged")}}
{{/if}}
{{plugin-outlet name="edit-topic" args=(hash model=model buffered=buffered)}}
+
<div class="edit-controls">
{{d-button action=(action "finishedEditingTopic") class="btn-primary submit-edit" icon="check"}}
{{d-button action=(action "cancelEditingTopic") class="btn-default cancel-edit" icon="times"}}