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: https://develop.svn.wordpress.org/trunk@20867 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-05-24 06:45:49 +00:00
parent 2b9809f381
commit 17fa8d52ec
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 ),
) );
}