UX: Show spinning icon while group members load.
This commit is contained in:
parent
3aed15c99e
commit
7ce4bc2e90
|
@ -1,6 +1,6 @@
|
|||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import Group from 'discourse/models/group';
|
||||
import { observes } from 'ember-addons/ember-computed-decorators';
|
||||
import { default as computed, observes } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
queryParams: ['order', 'desc'],
|
||||
|
@ -14,8 +14,17 @@ export default Ember.Controller.extend({
|
|||
|
||||
@observes('order', 'desc')
|
||||
refreshMembers() {
|
||||
this.set('loading', true);
|
||||
|
||||
this.get('model') &&
|
||||
this.get('model').findMembers({ order: this.get('order'), desc: this.get('desc') });
|
||||
this.get('model')
|
||||
.findMembers({ order: this.get('order'), desc: this.get('desc') })
|
||||
.finally(() => this.set('loading', false));
|
||||
},
|
||||
|
||||
@computed('model.members')
|
||||
hasMembers(members) {
|
||||
return members && members.length > 0;
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{#if model.members}}
|
||||
{{#if hasMembers}}
|
||||
{{group-membership-button model=model
|
||||
createNewMessageViaParams='createNewMessageViaParams'}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue