Skip to content

Commit

Permalink
dx.images shouldn't be a function
Browse files Browse the repository at this point in the history
  • Loading branch information
kjell committed Aug 20, 2013
1 parent 0626a12 commit e97d602
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions dx.js
Expand Up @@ -3,23 +3,20 @@ var json = require('./dx_json'),
_ = require('underscore')._

module.exports = dx = {
images: function() {
return _.flatten(_.reduce(json, function(memo, _images, id) {
memo.push(_images)
return memo
}))
},
images: _.flatten(_.reduce(json, function(memo, _images) {
memo.push(_images)
return memo
}, [])),

byName: function(name) {
return _.find(this.images(), function(image_json) {
return _.find(this.images, function(image_json) {
return image_json.image.match(name)
})
},

maxDimension: function(name) {
json = this.byName(name)
md = Math.max(json.max_width, json.max_height)
console.log('maxD', md)
return md
}
}

0 comments on commit e97d602

Please sign in to comment.