Skip to content

Commit 155f1fc

Browse files
Merge pull request Semantic-Org#242 from jenweber/master
Bugfix: use addon config options Semantic-Org#238
2 parents 9d5f93c + ace9b5a commit 155f1fc

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ module.exports = {
4848
if (typeof this._findHost === 'function') {
4949
app = this._findHost();
5050
}
51-
const options = (app && app.options['SemanticUI']) || (app && app.options['semantic-ui-ember']) || {};
51+
let options;
52+
if (app && app.options['SemanticUI']) {
53+
options = app.options['SemanticUI']
54+
} else if (app && app.options['semantic-ui-ember']) {
55+
options = app.options['semantic-ui-ember']
56+
} else {
57+
options = {}
58+
}
5259

5360
if (!fs.existsSync(defaults.source.css) && fs.existsSync(custom.source.css)) {
5461
defaults.source = custom.source

tape-tests/utils/get-default-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ var defaults = function() {
2222
};
2323
};
2424

25+
let customOptions = {
26+
import: {
27+
css: false
28+
}
29+
}
30+
2531
test('use the default path of the theme if not in the options', function (assert) {
2632
assert.plan(4);
2733
assert.equal(getDefault('paths', 'theme', [{}, defaults()]), 'default');
@@ -63,3 +69,8 @@ test('use old default location of imports', function (assert) {
6369
assert.plan(1);
6470
assert.equal(getDefault('imports', 'fonts', [oldDefaults, defaults()]), false);
6571
});
72+
73+
test('user-defined options are read', function (assert) {
74+
assert.plan(1);
75+
assert.equal(getDefault('import', 'css', [customOptions]), false);
76+
});

0 commit comments

Comments
 (0)