Make WordPress Core

Changeset 20867


Ignore:
Timestamp:
05/24/2012 06:45:49 AM (12 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r20854 r20867  
    17671767        <script type="text/javascript">
    17681768        //<![CDATA[
    1769         jQuery(document).ready( function($) {
    1770             var options = <?php echo json_encode( $args ); ?>;
     1769        (function($){
     1770            var options = <?php echo json_encode( $args ); ?>, setup;
    17711771
    17721772            if ( ! options )
     
    17821782            });
    17831783
    1784             $('<?php echo $selector; ?>').pointer( options ).pointer('open');
    1785         });
     1784            setup = function() {
     1785                $('<?php echo $selector; ?>').pointer( options ).pointer('open');
     1786            };
     1787
     1788            if ( options.deffer_loading )
     1789                $(window).bind( 'load.wp-pointers', setup );
     1790            else
     1791                $(document).ready( setup );
     1792
     1793        })( jQuery );
    17861794        //]]>
    17871795        </script>
     
    18591867        WP_Internal_Pointers::print_js( 'wp340_choose_image_from_library', '#choose-from-library-link', array(
    18601868            'content'  => $content,
    1861             'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left' ),
     1869            'position' => array( 'edge' => 'top', 'align' => is_rtl() ? 'right' : 'left', 'deffer_loading' => true ),
    18621870        ) );
    18631871    }
Note: See TracChangeset for help on using the changeset viewer.