This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/group-edit.js.es6
2016-12-13 15:15:20 +08:00

24 lines
533 B
JavaScript

import { popupAjaxError } from 'discourse/lib/ajax-error';
import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Controller.extend({
@computed('saving')
savingText(saving) {
if (saving !== undefined) {
return saving ? I18n.t('saving') : I18n.t('saved');
}
},
actions: {
save() {
this.set('saving', true);
this.get('model').save().catch(error => {
popupAjaxError(error);
}).finally(() => {
this.set('saving', false);
});
}
}
});