Make WordPress Core


Ignore:
Timestamp:
10/17/2020 09:58:34 AM (6 years ago)
Author:
azaozz
Message:

Fix and improve arranging of postboxes/metaboxes:

  • Enable arranging only when the Screen Options tab is open.
  • Prevent accidental/unintended dragging. Seen it happen mostly on laptops when using the mousepad/trackpad.
  • Improve discoverability and usefulness by always showing the "drop zones" outline when postboxes are draggable/arrangeable.
  • Add some (brief) explanation to the Screen Options tab helping the user understand what options are available and how to change them. This is especially helpful for screen reader users to give an idea how to use the screen options and what to expect.
  • Fix/enhance some of the code in postbox.js and make it coding standards compliant.

See #50699.

File:
1 edited

Legend:

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

    r49123 r49179  
    13361336                                                echo '<div class="handle-actions hide-if-no-js">';
    13371337
    1338                                                 echo '<button type="button" class="handle-order-higher" aria-disabled="false" aria-describedby="' . $box['id'] . '-handle-order-higher-description">';
     1338                                                echo '<button type="button" class="handle-order-higher postbox-arrange-arrow hidden" aria-disabled="true" aria-describedby="' . $box['id'] . '-handle-order-higher-description">';
    13391339                                                echo '<span class="screen-reader-text">' . __( 'Move up' ) . '</span>';
    13401340                                                echo '<span class="order-higher-indicator" aria-hidden="true"></span>';
    … …  
    13461346                                                ) . '</span>';
    13471347
    1348                                                 echo '<button type="button" class="handle-order-lower" aria-disabled="false" aria-describedby="' . $box['id'] . '-handle-order-lower-description">';
     1348                                                echo '<button type="button" class="handle-order-lower postbox-arrange-arrow hidden" aria-disabled="true" aria-describedby="' . $box['id'] . '-handle-order-lower-description">';
    13491349                                                echo '<span class="screen-reader-text">' . __( 'Move down' ) . '</span>';
    13501350                                                echo '<span class="order-lower-indicator" aria-hidden="true"></span>';
Note: See TracChangeset for help on using the changeset viewer.