From 5022507029fe951bb0a8dda8a262dcef2ff4d742 Mon Sep 17 00:00:00 2001 From: Kane York Date: Tue, 30 Jun 2015 16:00:43 -0700 Subject: [PATCH] Make observing optional --- .../javascripts/discourse/components/combo-box.js.es6 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/components/combo-box.js.es6 b/app/assets/javascripts/discourse/components/combo-box.js.es6 index 5ab4807fa..5fdd914e8 100644 --- a/app/assets/javascripts/discourse/components/combo-box.js.es6 +++ b/app/assets/javascripts/discourse/components/combo-box.js.es6 @@ -68,9 +68,10 @@ export default Ember.Component.extend({ o.selected = !!$(o).attr('selected'); }); - // Workaround for contentChanged not being able to observe based on - // a passed-in attribute name - this.addObserver('content.@each.' + this.get('realNameProperty'), this.rerender); + // observer for item names changing (optional) + if (this.get('nameChanges')) { + this.addObserver('content.@each.' + this.get('realNameProperty'), this.rerender); + } $elem.select2({formatResult: this.comboTemplate, minimumResultsForSearch: 5, width: 'resolve'});