Pointers: add arg to pointer options to load at window.loaded (after all images have been loaded and the layout is finalized) and use it on the custom header screen, see #20554

git-svn-id: http://core.svn.wordpress.org/trunk@20867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-05-24 06:45:49 +00:00
parent 02ed477f1b
commit b0e634031f
1 changed files with 13 additions and 5 deletions

View File

@ -1766,8 +1766,8 @@ final class WP_Internal_Pointers {
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready( function($) {
var options = <?php echo json_encode( $args ); ?>;
(function($){
var options = <?php echo json_encode( $args ); ?>, setup;
if ( ! options )
return;
@ -1781,8 +1781,16 @@ final class WP_Internal_Pointers {
}
});
$('<?php echo $selector; ?>').pointer( options ).pointer('open');
});
setup = function() {
$('<?php echo $selector; ?>').pointer( options ).pointer('open');
};
if ( options.deffer_loading )
$(window).bind( 'load.wp-pointers', setup );
else
$(document).ready( setup );
})( jQuery );
//]]>
</script>
<?php
@ -1858,7 +1866,7 @@ final class WP_Internal_Pointers {
WP_Internal_Pointers::print_js( 'wp340_choose_image_from_library', '#choose-from-library-link', array(
'content' => $content,
'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ),
'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'deffer_loading' => true ),
) );
}