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

21 lines
550 B
Plaintext
Raw Normal View History

export default Ember.ObjectController.extend({
saving: false,
saved: false,
saveDisabled: function() {
2013-06-26 10:57:35 -04:00
if (this.get('saving')) { return true; }
if ((!this.get('allow_blank')) && Ember.isEmpty(this.get('value'))) { return true; }
return false;
2014-09-24 14:45:35 -04:00
}.property('saving', 'value'),
2013-09-16 14:08:55 -04:00
actions: {
saveChanges: function() {
var self = this;
self.setProperties({saving: true, saved: false});
self.get('model').save().then(function () {
2013-09-16 14:08:55 -04:00
self.setProperties({saving: false, saved: true});
});
}
}
2013-09-16 14:08:55 -04:00
});