From d891665ac519efac6b648b454c275e88c70baa6a Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 9 Apr 2020 21:57:06 +0200 Subject: [PATCH] DEV: allows groups-selector to have an onChangeCallback (#9399) --- .../javascripts/discourse/components/group-selector.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/group-selector.js b/app/assets/javascripts/discourse/components/group-selector.js index 74c1c4b16f5..3fe2e505f85 100644 --- a/app/assets/javascripts/discourse/components/group-selector.js +++ b/app/assets/javascripts/discourse/components/group-selector.js @@ -35,7 +35,12 @@ export default Component.extend({ updateData: opts && opts.updateData ? opts.updateData : false, onChangeItems: items => { selectedGroups = items; - this.set("groupNames", items.join(",")); + + if (this.onChangeCallback) { + this.onChangeCallback(this.groupNames, selectedGroups); + } else { + this.set("groupNames", items.join(",")); + } }, transformComplete: g => { return g.name;