From 56be4bb8f07b8f8791ebc326c23ff8cbce35be92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 28 Aug 2019 21:25:49 +0200 Subject: [PATCH] FIX: don't search for tags when editing topic title --- app/assets/javascripts/discourse/controllers/topic.js.es6 | 4 ++++ app/assets/javascripts/discourse/templates/topic.hbs | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 @@ {{d-icon "envelope"}} {{/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)}} +
{{d-button action=(action "finishedEditingTopic") class="btn-primary submit-edit" icon="check"}} {{d-button action=(action "cancelEditingTopic") class="btn-default cancel-edit" icon="times"}}