mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Small optimization: remove a template with an {{if}}
This commit is contained in:
parent
5beac44731
commit
030bab92a2
2 changed files with 13 additions and 8 deletions
|
@ -1,8 +1,18 @@
|
|||
export default Ember.Component.extend({
|
||||
import StringBuffer from 'discourse/mixins/string-buffer';
|
||||
|
||||
export default Ember.Component.extend(StringBuffer, {
|
||||
classNameBindings: ['containerClass'],
|
||||
layoutName: 'components/conditional-loading-spinner',
|
||||
rerenderTriggers: ['condition'],
|
||||
|
||||
containerClass: function() {
|
||||
return (this.get('size') === 'small') ? 'inline-spinner' : undefined;
|
||||
}.property('size')
|
||||
}.property('size'),
|
||||
|
||||
renderString: function(buffer) {
|
||||
if (this.get('condition')) {
|
||||
buffer.push('<div class="spinner ' + this.get('size') + '"}}></div>');
|
||||
} else {
|
||||
return this._super();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{{#if condition}}
|
||||
<div {{bind-attr class=":spinner size"}}></div>
|
||||
{{else}}
|
||||
{{yield}}
|
||||
{{/if}}
|
Loading…
Reference in a new issue