mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:10:17 +08:00
Make observing optional
This commit is contained in:
parent
969fb2cd4c
commit
5022507029
|
@ -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'});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user