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

Added option to name registered easing method. #7

Merged
merged 1 commit into from Dec 11, 2014

Conversation

lucasconstantino
Copy link
Contributor

No description provided.

jQuery.extend({ bez: function(encodedFuncName, coOrdArray) {
if (jQuery.isFunction(encodedFuncName)) {
coOrdArray = encodedFuncName;
encodedFuncName = 'bez_' + jQuery.makeArray(arguments).join('_').replace(/\./g, 'p');
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure I understand this. Are you wanting to allow an optional argument to explicitly name an easing function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly. That would help reuse of these easing functions, like the following:

// Register a material design easing function:
$.bez('material', [0.55, 0, 0.1, 1]);

// Use it later in code:
$('.foo').fadeOut(500, 'material');

Copy link
Owner

Choose a reason for hiding this comment

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

Right, so isFunction should be isArray then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ouch, I'm sorry. I'll fix this and force the commit on this branch of mine ;) I just made this improvement for a code of mine, and didn't crossed my mind to try it with the old way haha.

@rdallasgray
Copy link
Owner

Thanks!

rdallasgray added a commit that referenced this pull request Dec 11, 2014
Added option to name registered easing method.
@rdallasgray rdallasgray merged commit 666a4e0 into rdallasgray:master Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants