mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:02:46 +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')
|
@computed('saving')
|
||||||
savingText(saving) {
|
savingText(saving) {
|
||||||
if (saving !== undefined) {
|
if (saving) return I18n.t("saving");
|
||||||
return saving ? I18n.t('saving') : I18n.t('saved');
|
return saving ? I18n.t("saving") : I18n.t("save");
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -16,6 +15,9 @@ export default Ember.Component.extend({
|
||||||
this.set('saving', true);
|
this.set('saving', true);
|
||||||
|
|
||||||
return this.get('model').save()
|
return this.get('model').save()
|
||||||
|
.then(() => {
|
||||||
|
this.set("saved", true);
|
||||||
|
})
|
||||||
.catch(popupAjaxError)
|
.catch(popupAjaxError)
|
||||||
.finally(() => this.set('saving', false));
|
.finally(() => this.set('saving', false));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
<div class='control-group buttons'>
|
<div class='control-group buttons'>
|
||||||
{{d-button action="save"
|
{{#d-button action="save"
|
||||||
disabled=saving
|
disabled=saving
|
||||||
class='btn btn-primary group-form-save'
|
class='btn btn-primary group-manage-save'}}
|
||||||
label="save"}}
|
|
||||||
|
{{savingText}}
|
||||||
|
{{/d-button}}
|
||||||
|
|
||||||
|
{{#if saved}}
|
||||||
|
<span>{{i18n 'saved'}}</span>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user