2054 posts
  • Affiliate Level 3
  • Author Level 11
  • Collector Level 2
  • Elite Author
+11 more
bitfade
says

I just recovered from a 2 hours long “wtf is going on ?? session”
here’s the issue: you call

tb_show('', 'media-upload.php?type=image&TB_iframe=true');

to let user add an image somewhere in your plugin/theme admin area but, as soon as thickbox window is closed, your tabs (or eventually other widget) stop working

Now, during the above session, i discovered that upon closing his windows thickbox calls:

jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload")

Once the Kraken is unleashed (unload event) he eventually reach your widget (jquery ui tabs in my case) which may reacts like this:

OMG ! The Kraken (unload event)! ALL IS LOST ! (self destroy)

Since this didn’t happen before 3.2, i think the issue is related to changes in trigger function with the new jQuery version (1.6)

anyway, the Kraken can be killed using this:

// placed right after tb_show call
$("#TB_window,#TB_overlay,#TB_HideSelect").one("unload",killTheDamnUnloadEvent);

function killTheDamnUnloadEvent(e) {
    // you
    e.stopPropagation();
    // must
    e.stopImmediatePropagation();
    // DIE!
    return false;
}

tought it was worth to share

470 posts
  • Trendsetter
  • Weekly Top Seller
  • Exclusive Author
  • 5 Years of Membership
+8 more
SaurabhSharma
says

Thanks for sharing that solution.

Now that we have a thread on WP3 .2 issues, let me share one more thing. There is an auto wrapping of the orphan <li /> tags inside the content editor (as of WordPress 3.2). i.e. when you will try to write the following code:

<li>my list item</li>

and switch between Visual/HTML mode. This code will be converted into:

<ul>
<li>my list item</li>
</ul>

Now since I was using some short code on stylish lists as:

[list params="foo"]
<li>my list item</li>
[/list]

It outputs the following code:

<ul class="as_defined_by_params">
<ul> //the added one by WP
<li>my list item</li>
</ul>
</ul>

For now, I am directly inserting the HTML markup via JS tinyMCE insertion. I am sure there would be some filter to override and prevent this auto wrapping of orphan list items.

Edit: @bitfade, sorry for posting another issue. (I think a single thread will be okay for any such things). Don’t mind mate. :)

1744 posts Building the Web.
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Beta Tester
+10 more
ZoomIt
says

Thanks for sharing

Just one question, how do you get to call tb_show with adding post_id to the parameters ?

I always get this error

invalid regular expression flag A
[Break On This Error] <b>Notice</b>: Undefined index: post_...dia.php on line <b>1423</b><br /> 

815 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 1
  • Freebie
+3 more
rvision_
says
bitfade said
tought it was worth to share

Man, you saved me…Same problem here….

I just thought I had to go all over this thickbox crap again and jquery.

Thank you very much :)

2054 posts
  • Affiliate Level 3
  • Author Level 11
  • Collector Level 2
  • Elite Author
+11 more
bitfade
says
rvision_ said
Man, you saved me…Same problem here….

I just thought I had to go all over this thickbox crap again and jquery.

Thank you very much :)
yeah …. pulled my hairs on this
glad it helped
737 posts
  • Affiliate Level 7
  • Author Level 8
  • Collector Level 3
  • Top Monthly Author
+9 more
mordauk
says

Definitely a good catch and glad you shared it! I haven’t run into this problem yet (I don’t think), but I’m sure I will.

485 posts
  • Author Level 5
  • Collector Level 3
  • Affiliate Level 7
  • Super Copyright Ninja
+3 more
readactor
says

thanks for share!

839 posts
  • Power Elite Author
  • Winner
  • Top Monthly Author
  • Trendsetter
+10 more
wpbakery
says

bitfade Thank you so much! You saved my day!

Envato community + Google = Rock \m/

25 posts
  • Elite Author
  • Germany
  • Exclusive Author
  • Featured Author
+6 more
doitmax
says

thank you bitfade, saved my day!

by
by
by
by
by
by