mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:03:15 +08:00
UX: Better 'saved' indication on group manage form.
This commit is contained in:
parent
b3a88109a8
commit
67ab6ab751
|
@ -6,9 +6,8 @@ export default Ember.Component.extend({
|
|||
|
||||
@computed('saving')
|
||||
savingText(saving) {
|
||||
if (saving !== undefined) {
|
||||
return saving ? I18n.t('saving') : I18n.t('saved');
|
||||
}
|
||||
if (saving) return I18n.t("saving");
|
||||
return saving ? I18n.t("saving") : I18n.t("save");
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
@ -16,6 +15,9 @@ export default Ember.Component.extend({
|
|||
this.set('saving', true);
|
||||
|
||||
return this.get('model').save()
|
||||
.then(() => {
|
||||
this.set("saved", true);
|
||||
})
|
||||
.catch(popupAjaxError)
|
||||
.finally(() => this.set('saving', false));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<div class='control-group buttons'>
|
||||
{{d-button action="save"
|
||||
{{#d-button action="save"
|
||||
disabled=saving
|
||||
class='btn btn-primary group-form-save'
|
||||
label="save"}}
|
||||
class='btn btn-primary group-manage-save'}}
|
||||
|
||||
{{savingText}}
|
||||
{{/d-button}}
|
||||
|
||||
{{#if saved}}
|
||||
<span>{{i18n 'saved'}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user