mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-25 08:39:38 -05:00
26 lines
709 B
JavaScript
26 lines
709 B
JavaScript
/**
|
|
This controller is used for editing site content
|
|
|
|
@class AdminSiteContentEditController
|
|
@extends Ember.ObjectController
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
export default Discourse.Controller.extend({
|
|
|
|
saveDisabled: function() {
|
|
if (this.get('saving')) { return true; }
|
|
if ((!this.get('content.allow_blank')) && this.blank('content.content')) { return true; }
|
|
return false;
|
|
}.property('saving', 'content.content'),
|
|
|
|
actions: {
|
|
saveChanges: function() {
|
|
var self = this;
|
|
self.setProperties({saving: true, saved: false});
|
|
self.get('content').save().then(function () {
|
|
self.setProperties({saving: false, saved: true});
|
|
});
|
|
}
|
|
}
|
|
});
|