optimize OpenComposer Mixin
This commit is contained in:
parent
c76caca109
commit
99c1aa2e85
|
@ -1,9 +1,9 @@
|
|||
// This mixin allows a route to open the composer
|
||||
import Composer from 'discourse/models/composer';
|
||||
|
||||
export default Ember.Mixin.create({
|
||||
|
||||
openComposer(controller) {
|
||||
const Composer = require('discourse/models/composer').default;
|
||||
this.controllerFor('composer').open({
|
||||
categoryId: controller.get('category.id'),
|
||||
action: Composer.CREATE_TOPIC,
|
||||
|
@ -13,7 +13,6 @@ export default Ember.Mixin.create({
|
|||
},
|
||||
|
||||
openComposerWithTopicParams(controller, topicTitle, topicBody, topicCategoryId, topicCategory) {
|
||||
const Composer = require('discourse/models/composer').default;
|
||||
this.controllerFor('composer').open({
|
||||
action: Composer.CREATE_TOPIC,
|
||||
topicTitle,
|
||||
|
@ -26,7 +25,6 @@ export default Ember.Mixin.create({
|
|||
},
|
||||
|
||||
openComposerWithMessageParams(usernames, topicTitle, topicBody) {
|
||||
const Composer = require('discourse/models/composer').default;
|
||||
this.controllerFor('composer').open({
|
||||
action: Composer.PRIVATE_MESSAGE,
|
||||
usernames,
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
//= require ./discourse/models/badge-grouping
|
||||
//= require ./discourse/models/badge
|
||||
//= require ./discourse/models/category
|
||||
//= require_tree ./discourse/mixins
|
||||
//= require ./discourse/lib/ajax-error
|
||||
//= require ./discourse/lib/markdown
|
||||
//= require ./discourse/lib/search
|
||||
|
@ -52,6 +51,7 @@
|
|||
//= require ./discourse/models/user-action
|
||||
//= require ./discourse/models/draft
|
||||
//= require ./discourse/models/composer
|
||||
//= require_tree ./discourse/mixins
|
||||
//= require ./discourse/models/invite
|
||||
//= require ./discourse/models/user-badge
|
||||
//= require ./discourse/controllers/discovery-sortable
|
||||
|
|
Loading…
Reference in New Issue