Make WordPress Core

Changeset 35925


Ignore:
Timestamp:
12/14/2015 04:39:48 PM (9 years ago)
Author:
afercia
Message:

Authentication modal dialog: the spinner should disappear when loading is done.

Also, when using spinners as background images, the re-painted area should be the
smallest possible one. See similar performance issue in #33311.

Fixes #34951.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/css/wp-auth-check.css

    r34011 r35925  
    4949
    5050#wp-auth-check-wrap #wp-auth-check-form {
    51     background: url(../images/spinner-2x.gif) no-repeat center center;
    52     -webkit-background-size: 16px 16px;
    53     background-size: 16px 16px;
    5451    height: 100%;
     52    position: relative;
    5553    overflow: auto;
    5654    -webkit-overflow-scrolling: touch;
     55}
     56
     57#wp-auth-check-form.loading:before {
     58    content: "";
     59    display: block;
     60    width: 20px;
     61    height: 20px;
     62    position: absolute;
     63    left: 50%;
     64    top: 50%;
     65    margin: -10px 0 0 -10px;
     66    background: url(../images/spinner.gif) no-repeat center;
     67    -webkit-background-size: 20px 20px;
     68    background-size: 20px 20px;
     69    -webkit-transform: translateZ(0);
     70    transform: translateZ(0);
     71}
     72
     73@media print,
     74  (-webkit-min-device-pixel-ratio: 1.25),
     75  (min-resolution: 120dpi) {
     76
     77    #wp-auth-check-form.loading:before {
     78        background-image: url(../images/spinner-2x.gif);
     79    }
     80
    5781}
    5882
  • trunk/src/wp-includes/functions.php

    r35880 r35925  
    49404940    if ( $same_domain ) {
    49414941        ?>
    4942         <div id="wp-auth-check-form" data-src="<?php echo esc_url( add_query_arg( array( 'interim-login' => 1 ), $login_url ) ); ?>"></div>
     4942        <div id="wp-auth-check-form" class="loading" data-src="<?php echo esc_url( add_query_arg( array( 'interim-login' => 1 ), $login_url ) ); ?>"></div>
    49434943        <?php
    49444944    }
  • trunk/src/wp-includes/js/wp-auth-check.js

    r35568 r35925  
    2121
    2222                loaded = true;
     23                // Remove the spinner to avoid unnecessary CPU/GPU usage.
     24                form.removeClass( 'loading' );
    2325
    2426                try {
     
    4749            }).attr( 'src', form.data('src') );
    4850
    49             $('#wp-auth-check-form').append( frame );
     51            form.append( frame );
    5052        }
    5153
Note: See TracChangeset for help on using the changeset viewer.