diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index e5f790a79b7..ed7030da299 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -95,11 +95,6 @@ export default DiscourseController.extend({ }, - updateDraftStatus() { - const c = this.get('model'); - if (c) { c.updateDraftStatus(); } - }, - appendText(text, opts) { const c = this.get('model'); if (c) { diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js index 2e249e6c809..af70156cb79 100644 --- a/app/assets/javascripts/discourse/models/composer.js +++ b/app/assets/javascripts/discourse/models/composer.js @@ -242,31 +242,6 @@ Discourse.Composer = Discourse.Model.extend({ return reply.replace(/\s+/img, " ").trim().length; }.property('reply'), - - updateDraftStatus: function() { - var $title = $('#reply-title'), - $reply = $('#wmd-input'); - - // 'title' is focused - if ($title.is(':focus')) { - var titleDiff = this.get('missingTitleCharacters'); - if (titleDiff > 0) { - this.flashDraftStatusForNewUser(); - return this.set('draftStatus', I18n.t('composer.min_length.need_more_for_title', { n: titleDiff })); - } - // 'reply' is focused - } else if ($reply.is(':focus')) { - var replyDiff = this.get('missingReplyCharacters'); - if (replyDiff > 0) { - return this.set('draftStatus', I18n.t('composer.min_length.need_more_for_reply', { n: replyDiff })); - } - } - - // hide the counters if the currently focused text field is OK - this.set('draftStatus', null); - - }.observes('missingTitleCharacters', 'missingReplyCharacters'), - init: function() { this._super(); var val = (Discourse.Mobile.mobileView ? false : (Discourse.KeyValueStore.get('composer.showPreview') || 'true')); @@ -655,17 +630,9 @@ Discourse.Composer = Discourse.Model.extend({ return Discourse.Draft.save(this.get('draftKey'), this.get('draftSequence'), data) .then(function() { composer.set('draftStatus', I18n.t('composer.saved_draft_tip')); - }, function() { + }).catch(function() { composer.set('draftStatus', I18n.t('composer.drafts_offline')); }); - }, - - flashDraftStatusForNewUser: function() { - var $draftStatus = $('#draft-status'); - if (Discourse.User.currentProp('trust_level') === 0) { - $draftStatus.toggleClass('flash', true); - setTimeout(function() { $draftStatus.removeClass('flash'); }, 250); - } } }); diff --git a/app/assets/javascripts/discourse/views/composer.js.es6 b/app/assets/javascripts/discourse/views/composer.js.es6 index 543705053ad..994208dac9c 100644 --- a/app/assets/javascripts/discourse/views/composer.js.es6 +++ b/app/assets/javascripts/discourse/views/composer.js.es6 @@ -49,11 +49,6 @@ const ComposerView = Discourse.View.extend(Ember.Evented, { Ember.run.scheduleOnce('afterRender', this, 'refreshPreview'); }.observes('model.reply', 'model.hidePreview'), - focusIn() { - const controller = this.get('controller'); - if (controller) controller.updateDraftStatus(); - }, - movePanels(sizePx) { $('#main-outlet').css('padding-bottom', sizePx); $('.composer-popup').css('bottom', sizePx); diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss index 0a0fc25a5a5..5ca857accb7 100644 --- a/app/assets/stylesheets/desktop/compose.scss +++ b/app/assets/stylesheets/desktop/compose.scss @@ -93,17 +93,12 @@ .toggle-preview { right: 5px; } - #file-uploading { - left: 51%; - font-size: 0.857em; - color: $primary; - } - #draft-status { + #draft-status, #file-uploading { right: 51%; color: $primary; - &.flash { - color: $danger; - } + } + #file-uploading { + font-size: 0.857em; } transition: height 0.4s ease; width: 100%; diff --git a/app/assets/stylesheets/mobile/compose.scss b/app/assets/stylesheets/mobile/compose.scss index b9aa33e94bb..b35bd8096bd 100644 --- a/app/assets/stylesheets/mobile/compose.scss +++ b/app/assets/stylesheets/mobile/compose.scss @@ -34,9 +34,6 @@ display: none !important; // can be removed if inline JS CSS is removed from com } #draft-status { color: scale-color($primary, $lightness: 75%); - &.flash { - color: $danger; - } } transition: height 0.4s ease; width: 100%; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 79e67bb94a6..97679bf05cd 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -678,10 +678,6 @@ en: similar_topics: "Your topic is similar to..." drafts_offline: "drafts offline" - min_length: - need_more_for_title: "{{n}} to go for the title" - need_more_for_reply: "{{n}} to go" - error: title_missing: "Title is required" title_too_short: "Title must be at least {{min}} characters"