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 22:57:35 +08:00
if (this.get('saving')) { return true; }
if ((!this.get('allow_blank')) && Ember.isEmpty(this.get('value'))) { return true; }
return false;
2014-09-25 02:45:35 +08:00
}.property('saving', 'value'),
2013-09-17 02:08:55 +08:00
actions: {
saveChanges: function() {
var self = this;
self.setProperties({saving: true, saved: false});
self.get('model').save().then(function () {
2013-09-17 02:08:55 +08:00
self.setProperties({saving: false, saved: true});
});
}
}
2013-09-17 02:08:55 +08:00
});