diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index c39b58a55b3..6334be90d48 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -14,6 +14,7 @@ export default Discourse.Controller.extend({ showEditReason: false, editReason: null, + maxTitleLength: Discourse.computed.setting('max_topic_title_length'), _initializeSimilar: function() { this.set('similarTopics', []); diff --git a/app/assets/javascripts/discourse/controllers/topic_controller.js b/app/assets/javascripts/discourse/controllers/topic_controller.js index bb6600545f8..6b9eb6abf6c 100644 --- a/app/assets/javascripts/discourse/controllers/topic_controller.js +++ b/app/assets/javascripts/discourse/controllers/topic_controller.js @@ -7,6 +7,8 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected selectedReplies: null, queryParams: ['filter', 'username_filters', 'show_deleted'], + maxTitleLength: Discourse.computed.setting('max_topic_title_length'), + contextChanged: function(){ this.set('controllers.search.searchContext', this.get('model.searchContext')); }.observes('topic'), diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index 66a0dd3d219..f5ed48bd2ef 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -38,7 +38,7 @@ {{/if}}