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
Comments
YEAH !!! |
I will definitely add this once I finish the changes I'm currently working on. |
Great, thanks!! |
I have applied the patch. Please test and let me know if you're experiencing problems. |
ok thx ... updating asap, and we'll let you know ... thx again, cool. |
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
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.
The text was updated successfully, but these errors were encountered: