brunschgi/terrificjs — pull request #14 by MarcDiethelm (2012-05-09 19:43:49+00:00)
Title: Adding a namespace to the Terrific-specific $.data, perf improvements

Note: I've no idea, why there are 5 commits displayed in this pull. The actual changes are only in the last two. There's nothing else.

1) I propose to rename the Terrific-specific $.data identifiers and data attributes to use a namespace (tc-). I don't think putting $.data('id') on the module is a good practice. In fact I already had a naming collision once.

2) Some small performance tweaks concerning the use of $elem.data(identifier) vs. $.data(elem, identifier). The latter is faster. However to read a data attr into jQuery from the DOM $elem.data must be used once. My changes reflect that, and also store the value in a var to prevent an extra call.