WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/12/2018 05:28:30 PM (4 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.

File:
1 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 );
Note: See TracChangeset for help on using the changeset viewer.