mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: allow pasting links into title field that are longer than the max title length
This commit is contained in:
@@ -31,6 +31,13 @@ export default Ember.Component.extend({
|
||||
}
|
||||
},
|
||||
|
||||
@computed('watchForLink')
|
||||
titleMaxLength() {
|
||||
// maxLength gets in the way of pasting long links, so don't use it if featured links are allowed.
|
||||
// Validation will display a message if titles are too long.
|
||||
return this.get('watchForLink') ? null : this.siteSettings.max_topic_title_length;
|
||||
},
|
||||
|
||||
@observes('composer.titleLength', 'watchForLink')
|
||||
_titleChanged() {
|
||||
if (this.get('composer.titleLength') === 0) { this.set('autoPosted', false); }
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{text-field value=composer.title
|
||||
tabindex="2"
|
||||
id="reply-title"
|
||||
maxLength=siteSettings.max_topic_title_length
|
||||
maxLength=titleMaxLength
|
||||
placeholderKey=composer.titlePlaceholder
|
||||
disabled=composer.loading}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user