From 7efa4c1844d5579931274b9dc0685680f7830a08 Mon Sep 17 00:00:00 2001 From: Mateusz Nowak Date: Tue, 18 Apr 2017 14:47:30 +0200 Subject: [PATCH] Adding support for using this addon inside other addons --- index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6765613..024b7a1 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,14 @@ module.exports = { included: function(app) { this._super.included(app); - app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/js/bootstrap-datepicker.js'); - app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/css/bootstrap-datepicker.css'); + if (process.env.EMBER_CLI_FASTBOOT !== 'true') { + if (typeof this.import === 'function' && !app.bowerDirectory) { + this.import('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js'); + this.import('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.css'); + } else { + app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/js/bootstrap-datepicker.js'); + app.import(app.bowerDirectory + '/bootstrap-datepicker/dist/css/bootstrap-datepicker.css'); + } + } } };