mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 23:54:16 +08:00
FIX: Limit the maxLength
of the title text fields to the site setting
for the maximum length.
This commit is contained in:
parent
4b97d8300d
commit
0175ba000f
|
@ -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', []);
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
{{/if}}
|
||||
|
||||
<div class="title-input">
|
||||
{{text-field value=model.title tabindex="2" id="reply-title" maxlength="255" placeholderKey="composer.title_placeholder"}}
|
||||
{{text-field value=model.title tabindex="2" id="reply-title" maxLength=maxTitleLength placeholderKey="composer.title_placeholder"}}
|
||||
{{popupInputTip validation=view.titleValidation shownAt=view.showTitleTip}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
{{else}}
|
||||
{{category-chooser valueAttribute="id" value=newCategoryId source=category_id}}
|
||||
{{/if}}
|
||||
{{text-field id='edit-title' value=newTitle}}
|
||||
{{text-field id='edit-title' value=newTitle maxLength=maxTitleLength}}
|
||||
|
||||
<button class='btn btn-primary btn-small no-text' {{action finishedEditingTopic}}><i class='fa fa-check'></i></button>
|
||||
<button class='btn btn-small no-text' {{action cancelEditingTopic}}><i class='fa fa-times'></i></button>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
@module Discourse
|
||||
**/
|
||||
export default Ember.TextField.extend({
|
||||
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus'],
|
||||
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus', 'maxLength'],
|
||||
|
||||
placeholder: function() {
|
||||
if (this.get('placeholderKey')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user