fix: reply draft won't save

This commit is contained in:
Régis Hanol 2013-03-16 18:14:54 +01:00
parent 837dea355c
commit 83b8a3386f
1 changed files with 5 additions and 1 deletions

View File

@ -426,9 +426,13 @@ Discourse.Composer = Discourse.Model.extend({
},
saveDraft: function() {
// Do not save when drafts are disabled
if (this.get('disableDrafts')) return;
// Do not save when there is no reply
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;
var data = {