Skip to content

Commit

Permalink
Merge pull request #16 from kaliber5/fix-options
Browse files Browse the repository at this point in the history
Fix use of options to not override options property of EmberAddon super class
  • Loading branch information
Andreas Schacht authored Mar 27, 2017
2 parents bdcb206 + f4257ec commit 0248ee5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ module.exports = {
return;
let config = baseConfig['responsive-image'];
let url = baseConfig.rootURL || baseConfig.baseURL || '';
this.options = [];
this.addonOptions = [];

if (Array.isArray(config) === false) {
config = [config];
}
config.forEach((item) => {
let extendedConfig = extend(defaultConfig(env), item);
extendedConfig.rootURL = url;
this.options.push(extendedConfig);
this.addonOptions.push(extendedConfig);
})
},

Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = {
this.metaData.prepend = this.app.options.fingerprint.prepend;
}
let trees = [];
this.options.forEach((options) => {
this.addonOptions.forEach((options) => {
let imageTree = this.resizeImages(tree, options)
trees.push(imageTree);
});
Expand All @@ -120,7 +120,7 @@ module.exports = {
},

postBuild(result) {
this.options.forEach((options) => {
this.addonOptions.forEach((options) => {
if (options.removeSourceDir) {
// remove folder with source files
rimraf.sync(path.join(result.directory, options.sourceDir));
Expand Down

0 comments on commit 0248ee5

Please sign in to comment.