mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
BUG: editing first PM was showing category selector
This commit is contained in:
parent
9e815dbef9
commit
30bedff2c9
2 changed files with 11 additions and 6 deletions
|
@ -27,13 +27,18 @@ Discourse.Composer = Discourse.Model.extend({
|
|||
|
||||
creatingTopic: Em.computed.equal('action', CREATE_TOPIC),
|
||||
creatingPrivateMessage: Em.computed.equal('action', PRIVATE_MESSAGE),
|
||||
notCreatingPrivateMessage: Em.computed.not('creatingPrivateMessage'),
|
||||
|
||||
privateMessage: function(){
|
||||
return this.get('creatingPrivateMessage') || this.get('topic.archetype') === 'private_message';
|
||||
}.property('creatingPrivateMessage', 'topic'),
|
||||
|
||||
editingPost: Em.computed.equal('action', EDIT),
|
||||
replyingToTopic: Em.computed.equal('action', REPLY),
|
||||
|
||||
viewOpen: Em.computed.equal('composeState', OPEN),
|
||||
viewDraft: Em.computed.equal('composeState', DRAFT),
|
||||
|
||||
notCreatingPrivateMessage: Em.computed.not('creatingPrivateMessage'),
|
||||
|
||||
archetype: function() {
|
||||
return this.get('archetypes').findProperty('id', this.get('archetypeId'));
|
||||
|
@ -175,12 +180,12 @@ Discourse.Composer = Discourse.Model.extend({
|
|||
@property minimumTitleLength
|
||||
**/
|
||||
minimumTitleLength: function() {
|
||||
if (this.get('creatingPrivateMessage')) {
|
||||
if (this.get('privateMessage')) {
|
||||
return Discourse.SiteSettings.min_private_message_title_length;
|
||||
} else {
|
||||
return Discourse.SiteSettings.min_topic_title_length;
|
||||
}
|
||||
}.property('creatingPrivateMessage'),
|
||||
}.property('privateMessage'),
|
||||
|
||||
/**
|
||||
Number of missing characters in the reply until valid.
|
||||
|
@ -197,12 +202,12 @@ Discourse.Composer = Discourse.Model.extend({
|
|||
@property minimumPostLength
|
||||
**/
|
||||
minimumPostLength: function() {
|
||||
if( this.get('creatingPrivateMessage') ) {
|
||||
if( this.get('privateMessage') ) {
|
||||
return Discourse.SiteSettings.min_private_message_post_length;
|
||||
} else {
|
||||
return Discourse.SiteSettings.min_post_length;
|
||||
}
|
||||
}.property('creatingPrivateMessage'),
|
||||
}.property('privateMessage'),
|
||||
|
||||
/**
|
||||
Computes the length of the title minus non-significant whitespaces
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
{{popupInputTip validation=view.titleValidation shownAt=view.showTitleTip}}
|
||||
</div>
|
||||
|
||||
{{#unless model.creatingPrivateMessage}}
|
||||
{{#unless model.privateMessage}}
|
||||
<div class="category-input">
|
||||
{{categoryChooser valueAttribute="id" value=model.categoryId}}
|
||||
{{popupInputTip validation=view.categoryValidation shownAt=view.showCategoryTip}}
|
||||
|
|
Loading…
Reference in a new issue