Don't use a string buffer to refactor loading outlet

This commit is contained in:
Robin Ward 2015-01-02 16:35:56 -05:00
parent 030bab92a2
commit 1e441522c0

View File

@ -1,18 +1,19 @@
import StringBuffer from 'discourse/mixins/string-buffer'; export default Ember.Component.extend({
export default Ember.Component.extend(StringBuffer, {
classNameBindings: ['containerClass'], classNameBindings: ['containerClass'],
rerenderTriggers: ['condition'],
containerClass: function() { containerClass: function() {
return (this.get('size') === 'small') ? 'inline-spinner' : undefined; return (this.get('size') === 'small') ? 'inline-spinner' : undefined;
}.property('size'), }.property('size'),
renderString: function(buffer) { render: function(buffer) {
if (this.get('condition')) { if (this.get('condition')) {
buffer.push('<div class="spinner ' + this.get('size') + '"}}></div>'); buffer.push('<div class="spinner ' + this.get('size') + '"}}></div>');
} else { } else {
return this._super(); return this._super();
} }
} },
_conditionChanged: function() {
this.rerender();
}.observes('condition')
}); });