From 99c1aa2e85bf8137dba8691ff86afb23a30f0939 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 24 Nov 2015 23:34:24 +0530 Subject: [PATCH] optimize OpenComposer Mixin --- app/assets/javascripts/discourse/mixins/open-composer.js.es6 | 4 +--- app/assets/javascripts/main_include.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/mixins/open-composer.js.es6 b/app/assets/javascripts/discourse/mixins/open-composer.js.es6 index d2e79622b47..5d432f20b09 100644 --- a/app/assets/javascripts/discourse/mixins/open-composer.js.es6 +++ b/app/assets/javascripts/discourse/mixins/open-composer.js.es6 @@ -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, diff --git a/app/assets/javascripts/main_include.js b/app/assets/javascripts/main_include.js index 853d0d5e241..b1fedd814a8 100644 --- a/app/assets/javascripts/main_include.js +++ b/app/assets/javascripts/main_include.js @@ -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