mirror of
git://develop.git.wordpress.org/
synced 2025-01-18 05:18:42 +01:00
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. Merges [43246] to the 4.9 branch. Fixes #44045. git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43253 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8fa3eaed8a
commit
daf584fb2c
@ -170,18 +170,20 @@ final class WP_Internal_Pointers {
|
||||
if ( is_rtl() ) {
|
||||
$position = array(
|
||||
'edge' => 'right',
|
||||
'align' => 'left',
|
||||
'align' => 'bottom',
|
||||
);
|
||||
} else {
|
||||
$position = array(
|
||||
'edge' => 'left',
|
||||
'align' => 'right',
|
||||
'align' => 'bottom',
|
||||
);
|
||||
}
|
||||
|
||||
$js_args = array(
|
||||
'content' => $content,
|
||||
'position' => $position,
|
||||
'pointerClass' => 'wp-pointer arrow-bottom',
|
||||
'pointerWidth' => 420,
|
||||
);
|
||||
self::print_js( 'wp496_privacy', '#menu-tools', $js_args );
|
||||
}
|
||||
|
@ -207,6 +207,15 @@
|
||||
content: " ";
|
||||
}
|
||||
|
||||
.wp-pointer.arrow-bottom .wp-pointer-content {
|
||||
margin-bottom: -45px;
|
||||
}
|
||||
|
||||
.wp-pointer.arrow-bottom .wp-pointer-arrow {
|
||||
top: 100%;
|
||||
margin-top: -30px;
|
||||
}
|
||||
|
||||
/* Disable pointers at responsive sizes */
|
||||
@media screen and ( max-width: 782px ) {
|
||||
.wp-pointer {
|
||||
|
Loading…
x
Reference in New Issue
Block a user