@toscho Ah, I found a bug in your code. Please bare with me. Do the exact following to replicate the issue:
1) Open a draft post.
2) Click on Add Media
button. Wait for the jQuery function to load.
3) On your left, click on the Set Featured Image
link.
4) Now close the Media popup window and on the post edit page, click on the Set featured image
link on the right side-bar.
5) You will see that the jQuery function will not work.
However, if you would have clicked on the Set featured image
link first on post edit load, the function would work. Can you replicate this issue and possibly find a solution? Sorry again for posting this as an answer but this platform does not offer me a better option currently.
EDIT: Can someone please let toscho know about this. You can do this by adding a comment to his answer which I believe should give him a notification. I cannot write comments as I do not have enough reputation...
EDIT 2: If you want to desperately avoid this issue, you can remove the "Set Featured Image" link in the popup and force the user to use the sidebar link (like WP versions prior to 3.5). Use this filter that was introduced in WP 3.5:
add_filter( 'media_view_strings', 'cor_media_view_strings' );
/**
* @see wp-includes|media.php
*/
function cor_media_view_strings( $strings ) {
unset( $strings['setFeaturedImageTitle'] );
return $strings;
}
As I said, this is a desperate fix until there is a solution posted for the main code.