Make WordPress Core

Changeset 43246


Ignore:
Timestamp:
05/12/2018 05:28:30 PM (6 years ago)
Author:
iandunn
Message:

Privacy: Reposition pointer to ensure dismiss link is always visible.

r43158 introduced a new admin pointer for the privacy tools added in 4.9.6. With the previous positioning, though, sometimes the Dismiss link would be fixed off screen, making it impossible for the user to dismiss the pointer. This happened when there were enough extra menu items, or when the viewport height was short enough.

This commit repositions the pointer to work around that problem. One down side of this workaround is that the arrow will not always be positioned next to the Tools menu, where it should be. That's an acceptable compromise given the current time constraints, though. A long term solution would be to make WP_Pointer robust enough to handle this use case.

Props imath, audrasjb, desrosj.
Fixes #44045.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-internal-pointers.php

    r43210 r43246  
    171171            $position = array(
    172172                'edge'  => 'right',
    173                 'align' => 'left',
     173                'align' => 'bottom',
    174174            );
    175175        } else {
    176176            $position = array(
    177177                'edge'  => 'left',
    178                 'align' => 'right',
     178                'align' => 'bottom',
    179179            );
    180180        }
     
    183183            'content'  => $content,
    184184            'position' => $position,
     185            'pointerClass' => 'wp-pointer arrow-bottom',
     186            'pointerWidth' => 420,
    185187        );
    186188        self::print_js( 'wp496_privacy', '#menu-tools', $js_args );
  • trunk/src/wp-includes/css/wp-pointer.css

    r43210 r43246  
    208208}
    209209
     210.wp-pointer.arrow-bottom .wp-pointer-content {
     211    margin-bottom: -45px;
     212}
     213
     214.wp-pointer.arrow-bottom .wp-pointer-arrow {
     215    top: 100%;
     216    margin-top: -30px;
     217}
     218
    210219/* Disable pointers at responsive sizes */
    211220@media screen and ( max-width: 782px ) {
Note: See TracChangeset for help on using the changeset viewer.