Klaus Hartl wrote:
> Never mind, the cleanest solution will be returning false for the
> onclick handler for now.
Klaus,
Done. Inline is the patch, I've sent you the attached full version.
---
[EMAIL PROTECTED] ~]$ diff tabs.old.js tabs.new.js
391,395c391,393
< if (typeof onClick == 'function') {
< // without this timeout Firefox gets really
confused and calls callbacks twice...
< setTimeout(function() {
< onClick(clicked, toShow[0], toHide[0]);
< }, 0);
[EMAIL PROTECTED] ~]$ diff tabs.old.js tabs.new.js
391,395c391,393
< if (typeof onClick == 'function') {
< // without this timeout Firefox gets really
confused and calls callbacks twice...
< setTimeout(function() {
< onClick(clicked, toShow[0], toHide[0]);
< }, 0);
---
> if (typeof onClick == 'function' && onClick(clicked,
toShow[0], toHide[0]) == false && !init) {
> container['locked'] = false;
> return false;
396a395,396
>
> init = false;
533a534
> var init=true; // True if no has been activated. When true, the
onClick function's return will have no effect.
[EMAIL PROTECTED] ~]$
> if (typeof onClick == 'function' && onClick(clicked,
toShow[0], toHide[0]) == false && !init) {
> container['locked'] = false;
> return false;
396a395,396
>
> init = false;
533a534
> var init=true; // True if no has been activated. When true, the
onClick function's return will have no effect.
[EMAIL PROTECTED] ~]$
---
Now, I did get rid of that timeout. Unfortunately I do not have FF1.5 to
test with, but callbacks were *not* executed twice in FF2 with my
changes. I don't see why they'd be executed twice?
~ Brice
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/