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

27 lines
709 B
Plaintext
Raw Normal View History

/**
This controller is used for editing site content
@class AdminSiteContentEditController
@extends Ember.ObjectController
@namespace Discourse
@module Discourse
**/
export default Discourse.Controller.extend({
saveDisabled: function() {
2013-06-26 10:57:35 -04:00
if (this.get('saving')) { return true; }
if ((!this.get('content.allow_blank')) && this.blank('content.content')) { return true; }
return false;
}.property('saving', 'content.content'),
2013-09-16 14:08:55 -04: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-09-16 14:08:55 -04:00
});