-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (28 loc) · 963 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* eslint-env node */
'use strict';
// included stuff taken from ember-power-select: https://github.com/cibernox/ember-power-select/blob/master/index.js
function findHostShim() {
let current = this;
let app;
do {
app = current.app || app;
} while (current.parent.parent && (current = current.parent));
return app;
}
module.exports = {
name: 'ember-athlas-modal',
included(/*appOrAddon*/) {
let findHost = this._findHost || findHostShim;
let app = findHost.call(this);
if (!app.__emberAthlasModalIncludedInvoked) {
app.__emberAthlasModalIncludedInvoked = true;
this._super.included.apply(this, arguments);
let hasSass = !!app.registry.availablePlugins['ember-cli-sass'];
// let hasLess = !!app.registry.availablePlugins['ember-cli-less'];
// Don't include the precompiled css file if the user uses a supported CSS preprocessor
if (!hasSass/* && !hasLess*/) {
app.import('vendor/ember-athlas-modal.css');
}
}
}
};