WordPress.org

Make WordPress Core

Changeset 47217


Ignore:
Timestamp:
02/09/2020 04:30:41 PM (18 months ago)
Author:
afercia
Message:

Accessibility: Media: Make the toolbar and inline uploader visual order always match the DOM order.

Depending on the specific media view, the media UI elements are placed in a
different visual order. This change makes sure their visual order always
matches the DOM order.

Propos syhc, audrasjb, afercia.
See #37188.
Fixes #48403.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/views/attachments/browser.js

    r47122 r47217  
    5050
    5151        /*
    52          * For accessibility reasons, place the Inline Uploader before other sections.
    53          * This way, in the Media Library, it's right after the Add New button, see ticket #37188.
     52         * In the grid mode (the Media Library), place the Inline Uploader before
     53         * other sections so that the visual order and the DOM order match. This way,
     54         * the Inline Uploader in the Media Library is right after the "Add New"
     55         * button, see ticket #37188.
    5456         */
    55         this.createUploader();
    56 
    57         /*
    58          * Create a multi-purpose toolbar. Used as main toolbar in the Media Library
    59          * and also for other things, for example the "Drag and drop to reorder" and
    60          * "Suggested dimensions" info in the media modal.
    61          */
    62         this.createToolbar();
     57        if ( this.controller.isModeActive( 'grid' ) ) {
     58            this.createUploader();
     59
     60            /*
     61             * Create a multi-purpose toolbar. Used as main toolbar in the Media Library
     62             * and also for other things, for example the "Drag and drop to reorder" and
     63             * "Suggested dimensions" info in the media modal.
     64             */
     65            this.createToolbar();
     66        } else {
     67            this.createToolbar();
     68            this.createUploader();
     69        }
     70
    6371
    6472        // Add a heading before the attachments list.
Note: See TracChangeset for help on using the changeset viewer.