optimize OpenComposer Mixin

This commit is contained in:
Arpit Jalan 2015-11-24 23:34:24 +05:30
parent c76caca109
commit 99c1aa2e85
2 changed files with 2 additions and 4 deletions

View File

@ -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,

View File

@ -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