airbnb / infinity

UITableViews for the web (DEPRECATED)
http://airbnb.io/infinity/
Other
2.8k stars 281 forks source link

Refactoring + jQuery plugin #10

Closed re1ro closed 12 years ago

reissbaker commented 12 years ago

Nice! I like that you added a jQuery plugin interface -- people could find that useful.

That said, I'd like to keep the Javascript as "ordinary" as is practical -- since the minified+compressed size only changed by 65 bytes, the this/that and prototype/listViewPrototype swaps seem like they could probably be left out (in a quick and dirty local edit of your pull request, it seemed like the minified+compressed size of this branch using this and prototype was only 3 bytes larger than using that and listViewPrototype). In a larger library, I could see how that would be worth doing; in this case, readability is worth a few bytes.

Revert those two commits and this is good to go!

re1ro commented 12 years ago

Done. Should I update build files and documentation?

re1ro commented 12 years ago

And I have another question that's related to code formating.

There is a code convention about having a whitespace in

if ( 
for ( 
while ( 
function ( //anon function declaration

Should I reformat this?

reissbaker commented 12 years ago

Re:whitespace: nah. I prefer JSHint to Crockford's JSLint -- whitespace only matters if it's inconsistent (or messes with ASI). Infinity is very consistent, just not with Crockford's preferred formatting.

Merging in! No worries re:build files, docs -- I'll regenerate them now.

(Nice catch on the registerPlugin inside the noConflict.)