binarybottle / roygbiv

Roy G. Brain Image Viewer for browser-based visualization of Mindboggle cortical surface label/shape data
http://roygbiv.mindboggle.info
Other
9 stars 11 forks source link

Allow the Brain object constructor to take optional args #8

Closed bcipolli closed 9 years ago

bcipolli commented 9 years ago

Javascript sucks at optional arguments. We can either:

I prefer the latter. In this PR, I change the Brain constructor to accept an object. Any property not defined on the object gets a default value. I find this to be clean, readable code. I also found this used elsewhere: https://stackoverflow.com/questions/3147640/javascript-optional-arguments-in-function

Also mixed in this PR (sorry!) is a bunch of cleanup items.

bcipolli commented 9 years ago

@binarybottle please take a look at the Brain interface change. I think it's more like how ajax is called: pass an object with properties, rather than a list of arguments.