Merge pull request #480 from ZogStriP/fix-reply-draft-wont-save

fix: reply draft won't save
This commit is contained in:
Sam 2013-03-16 15:01:50 -07:00
commit ee1460e932
1 changed files with 5 additions and 1 deletions

View File

@ -426,9 +426,13 @@ Discourse.Composer = Discourse.Model.extend({
}, },
saveDraft: function() { saveDraft: function() {
// Do not save when drafts are disabled
if (this.get('disableDrafts')) return; if (this.get('disableDrafts')) return;
// Do not save when there is no reply
if (!this.get('reply')) return; if (!this.get('reply')) return;
if (this.get('titleLength') < Discourse.SiteSettings.min_topic_title_length) return; // Do not save when the title's length is too small (only when creating a new post)
if (this.get('creatingTopic') && this.get('titleLength') < Discourse.SiteSettings.min_topic_title_length) return;
// Do not save when the reply's length is too small
if (this.get('replyLength') < Discourse.SiteSettings.min_post_length) return; if (this.get('replyLength') < Discourse.SiteSettings.min_post_length) return;
var data = { var data = {