mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 08:15:00 +00: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,
|
showEditReason: false,
|
||||||
editReason: null,
|
editReason: null,
|
||||||
|
maxTitleLength: Discourse.computed.setting('max_topic_title_length'),
|
||||||
|
|
||||||
_initializeSimilar: function() {
|
_initializeSimilar: function() {
|
||||||
this.set('similarTopics', []);
|
this.set('similarTopics', []);
|
||||||
|
@ -7,6 +7,8 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
|||||||
selectedReplies: null,
|
selectedReplies: null,
|
||||||
queryParams: ['filter', 'username_filters', 'show_deleted'],
|
queryParams: ['filter', 'username_filters', 'show_deleted'],
|
||||||
|
|
||||||
|
maxTitleLength: Discourse.computed.setting('max_topic_title_length'),
|
||||||
|
|
||||||
contextChanged: function(){
|
contextChanged: function(){
|
||||||
this.set('controllers.search.searchContext', this.get('model.searchContext'));
|
this.set('controllers.search.searchContext', this.get('model.searchContext'));
|
||||||
}.observes('topic'),
|
}.observes('topic'),
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="title-input">
|
<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}}
|
{{popupInputTip validation=view.titleValidation shownAt=view.showTitleTip}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
{{category-chooser valueAttribute="id" value=newCategoryId source=category_id}}
|
{{category-chooser valueAttribute="id" value=newCategoryId source=category_id}}
|
||||||
{{/if}}
|
{{/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-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>
|
<button class='btn btn-small no-text' {{action cancelEditingTopic}}><i class='fa fa-times'></i></button>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
@module Discourse
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
export default Ember.TextField.extend({
|
export default Ember.TextField.extend({
|
||||||
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus'],
|
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus', 'maxLength'],
|
||||||
|
|
||||||
placeholder: function() {
|
placeholder: function() {
|
||||||
if (this.get('placeholderKey')) {
|
if (this.get('placeholderKey')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user