Skip to content

Commit

Permalink
Merge pull request #24 from EWhite613/master
Browse files Browse the repository at this point in the history
Fix issue in demo where entry was equal to ...
  • Loading branch information
sandersky committed Mar 18, 2016
2 parents 3452ed4 + 645c55c commit 8a2bf5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addon/components/frost-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default Ember.Component.extend({

if (_.isUndefined(svg)) {
Ember.assert('The svg ' + this.get('icon') + ' does not exist')
} else if (typeof svg !== 'string') {
Ember.assert('The svg path ' + this.get('icon') + ' is incomplete')
} else {
let classes = _.isString(this.get('class')) ? ' ' + this.get('class') : ''
svg = svg.replace('<svg', '<svg class="frost-icon' + classes + '"')
Expand Down
6 changes: 6 additions & 0 deletions tests/dummy/app/pods/demo/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export default Ember.Controller.extend({
icon,
markdown: `\`${icon}\``
}
}).filter((entry) => {
// filter out objects when used on frost-guide as it picks up other svgs (folder in folder)
// these nested folders return as objects with its properties equal to folders inside
if (typeof Ember.get(svgs, entry.icon.replace(/\//g, '.')) === 'string') {
return true
}
}))
}, [])
}),
Expand Down

0 comments on commit 8a2bf5a

Please sign in to comment.