mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 05:45:58 +08:00
17 lines
470 B
JavaScript
17 lines
470 B
JavaScript
export default Ember.Controller.extend({
|
|
saved: false,
|
|
|
|
saveDisabled: function() {
|
|
if (this.get('model.isSaving')) { return true; }
|
|
if ((!this.get('allow_blank')) && Ember.isEmpty(this.get('model.value'))) { return true; }
|
|
return false;
|
|
}.property('model.iSaving', 'model.value'),
|
|
|
|
actions: {
|
|
saveChanges() {
|
|
const model = this.get('model');
|
|
model.save(model.getProperties('value')).then(() => this.set('saved', true));
|
|
}
|
|
}
|
|
});
|