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

Let the ability to set function as the tracker option (Fix incldued) #15

Closed
nyroDev opened this issue Sep 1, 2010 · 6 comments
Closed

Comments

@nyroDev
Copy link

nyroDev commented Sep 1, 2010

Currently, we can only set a strong representing a function defined in the window object as the tracker, using the $.address.tracker(value); function.

In my current project which is relly important regarding memory leak and other stuff, we don't want to create many and many function in the window object.

The idea here is to check in the _track function if the _opts.tracker is a function or not. If it is, just use it directly. If not, just use the current beahvior.

THE FIX ::
On line 113, we have :
var fn = _t[_opts.tracker],

Just replace it by :
var fn = $.isFunction(_opts.tracker) ? _opts.tracker : _t[_opts.tracker],

and we're done.

Thanks a lot for your plugin, and including this fix will be great for many people I think.

@doud
Copy link

doud commented Sep 1, 2010

YEAH !!!
that rocks ...

@asual
Copy link
Owner

asual commented Sep 4, 2010

I will definitely add this once I finish the changes I'm currently working on.

@nyroDev
Copy link
Author

nyroDev commented Sep 4, 2010

Great, thanks!!

@asual
Copy link
Owner

asual commented Sep 9, 2010

I have applied the patch. Please test and let me know if you're experiencing problems.

@doud
Copy link

doud commented Sep 9, 2010

ok thx ... updating asap, and we'll let you know ... thx again, cool.

@nyroDev
Copy link
Author

nyroDev commented Sep 24, 2010

Looks good for me, and seems to work as expected, thanks!

This issue was closed.
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

No branches or pull requests

3 participants