Skip to content

Instantly share code, notes, and snippets.

@eviltrout
Created January 2, 2015 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eviltrout/ae03d8fbbec328b45300 to your computer and use it in GitHub Desktop.
Save eviltrout/ae03d8fbbec328b45300 to your computer and use it in GitHub Desktop.
import StringBuffer from 'discourse/mixins/string-buffer';
export default Ember.Component.extend(StringBuffer, {
classNameBindings: ['containerClass'],
rerenderTriggers: ['condition'],
containerClass: function() {
return (this.get('size') === 'small') ? 'inline-spinner' : undefined;
}.property('size'),
renderString: function(buffer) {
if (this.get('condition')) {
buffer.push('<div class="spinner ' + this.get('size') + '"}}></div>');
} else {
return this._super();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment