Make WordPress Core

Changeset 50027


Ignore:
Timestamp:
01/27/2021 10:57:43 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Rotate the Updates icon in the admin bar when performing inline updates on the Plugins screen.

This provides better indication within the viewport about ongoing processes on the page when updating several plugins at the same time, but without using the bulk updater.

Props ravipatel, audrasjb, johnjamesjacoby, paaljoachim, hellofromTonya, sabernhardt, mdwolinski, karmatosed, SergeyBiryukov.
Fixes #51476.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/updates.js

    r50001 r50027  
    444444     */
    445445    wp.updates.updatePlugin = function( args ) {
    446         var $updateRow, $card, $message, message;
     446        var $updateRow, $card, $message, message,
     447            $adminBarUpdates = $( '#wp-admin-bar-updates' );
    447448
    448449        args = _.extend( {
     
    472473        }
    473474
     475        $adminBarUpdates.addClass( 'spin' );
     476
    474477        if ( $message.html() !== __( 'Updating...' ) ) {
    475478            $message.data( 'originaltext', $message.html() );
     
    500503     */
    501504    wp.updates.updatePluginSuccess = function( response ) {
    502         var $pluginRow, $updateMessage, newText;
     505        var $pluginRow, $updateMessage, newText,
     506            $adminBarUpdates = $( '#wp-admin-bar-updates' );
    503507
    504508        if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
     
    521525                .addClass( 'button-disabled updated-message' );
    522526        }
     527
     528        $adminBarUpdates.removeClass( 'spin' );
    523529
    524530        $updateMessage
     
    554560     */
    555561    wp.updates.updatePluginError = function( response ) {
    556         var $card, $message, errorMessage;
     562        var $card, $message, errorMessage,
     563            $adminBarUpdates = $( '#wp-admin-bar-updates' );
    557564
    558565        if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
     
    631638            } );
    632639        }
     640
     641        $adminBarUpdates.removeClass( 'spin' );
    633642
    634643        wp.a11y.speak( errorMessage, 'assertive' );
  • trunk/src/wp-includes/css/admin-bar.css

    r50025 r50027  
    587587    content: "\f463";
    588588    top: 2px;
     589}
     590
     591#wpadminbar #wp-admin-bar-updates.spin .ab-icon:before {
     592    display: inline-block;
     593    animation: rotation 2s infinite linear;
    589594}
    590595
Note: See TracChangeset for help on using the changeset viewer.