discourse/app/assets/javascripts/admin/controllers/admin-site-text-edit.js.es6

17 lines
470 B
Text
Raw Normal View History

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'),
2013-09-16 14:08:55 -04:00
actions: {
saveChanges() {
const model = this.get('model');
model.save(model.getProperties('value')).then(() => this.set('saved', true));
2013-09-16 14:08:55 -04:00
}
}
2013-09-16 14:08:55 -04:00
});