Skip to content

Conversation

kalisjoshua
Copy link

I just saw you on CSS Summit today. I love the small library philosophy for JavaScript. Anyway I wanted to send you my two cents on fittext just in case you were looking for any collaboration. If not, I at least got to understand your code a little more. Keep on rockin out with the small JS libs.

};

// Resizer() resizes items based on the object width divided by the compressor * 10
function resizer (self, settings) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I factored this out of the plugin execution so that it doesn't need to be defined each time the plugin is called.

@davatron5000
Copy link
Owner

Does this mean defaults attaches global namespace? It should probably be under $.fn.fitText in order to be polite. Right?

@kalisjoshua
Copy link
Author

No, defaults isn't in the global scope. It is in the function/closure scope where the plugin is the only code that can access it. This way that value isn't re-evaluated each time the plugin is executed only once per page load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants