2014-08-13 07:04:36 +08:00
|
|
|
import DiscourseController from 'discourse/controllers/controller';
|
2013-04-05 00:59:44 +08:00
|
|
|
|
2014-08-13 07:04:36 +08:00
|
|
|
export default DiscourseController.extend({
|
2013-04-05 00:59:44 +08:00
|
|
|
|
|
|
|
saveDisabled: function() {
|
2013-06-26 22:57:35 +08:00
|
|
|
if (this.get('saving')) { return true; }
|
|
|
|
if ((!this.get('content.allow_blank')) && this.blank('content.content')) { return true; }
|
2013-04-05 00:59:44 +08:00
|
|
|
return false;
|
|
|
|
}.property('saving', 'content.content'),
|
|
|
|
|
2013-09-17 02:08:55 +08:00
|
|
|
actions: {
|
|
|
|
saveChanges: function() {
|
|
|
|
var self = this;
|
|
|
|
self.setProperties({saving: true, saved: false});
|
|
|
|
self.get('content').save().then(function () {
|
|
|
|
self.setProperties({saving: false, saved: true});
|
|
|
|
});
|
|
|
|
}
|
2013-04-05 00:59:44 +08:00
|
|
|
}
|
2013-09-17 02:08:55 +08:00
|
|
|
});
|