Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Refactored #35

wants to merge 1 commit into from

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.

None yet

2 participants