#19021 closed defect (bug) (fixed)
Broken pointers if attached to elements visible after scrolling page
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 3.4 | Priority: | normal |
| Severity: | minor | Version: | 3.3 |
| Component: | Administration | Keywords: | needs-patch 3.3.1 |
| Focuses: | Cc: |
Description
If you attach pointer for example to #footer it looks bad.
Try this code:
add_action( 'admin_enqueue_scripts', 'my_admin_enqueue_scripts' );
function my_admin_enqueue_scripts() {
// Using Pointers
wp_enqueue_style( 'wp-pointer' );
wp_enqueue_script( 'wp-pointer' );
// Register our action
add_action( 'admin_print_footer_scripts', 'my_admin_print_footer_scripts' );
}
function my_admin_print_footer_scripts() {
// This will run during footer scripts, use jQuery to show the pointer here.
$pointer_content = '<h3>Test</h3>';
$pointer_content .= '<p>Test';
?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready( function($) {
$('#footer').pointer({
content: '<?php echo $pointer_content; ?>',
position: 'bottom',
}).pointer('open');
});
//]]>
</script>
<?php
}
as you can see, arrow is over the infobox and even infobox is under footer. http://minus.com/mbde0EcLFG
I think it heppens only when footer is not visible after page load. When i tried this on some admin page, where scroll bar is not visible (page is shorter than window height) pointer was ok.
Attachments (2)
Change History (14)
#1
@
14 years ago
- Summary changed from Broken pointers if attached to elements visible after scroll of page to Broken pointers if attached to elements visible after scrolling page
#3
@
14 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
I'm not a JS pro and there is probably a better place to put this in wp-pointer.js but the attached patch works for me.
#4
@
14 years ago
- Component changed from Widgets to Administration
- Owner set to koopersmith
- Status changed from new to reviewing
#5
@
14 years ago
Since we are not doing any below-fold pointers in this release, I don't think this should be a blocker. @koopersmith: In or out?
#6
@
14 years ago
A blocker not, but to re-position the pointer if the screen will be resized makes sense.
#7
follow-up:
↓ 8
@
14 years ago
- Keywords needs-patch added; has-patch dev-feedback removed
- Severity changed from normal to minor
Misplaced arrows should no longer be an issue (the positioning code was simplified when we added the new pointer styles).
We should reposition the pointers when the screen is resized, but should not do so every time the resize event is fired. An appropriate balance between accuracy and speed would be to hide the pointer as the window begins to resize, and show it again (thereby repositioning it) once the resize has completed (due to the resize event not being triggered for a set amount of time).
#8
in reply to:
↑ 7
@
14 years ago
Replying to koopersmith:
Misplaced arrows should no longer be an issue (the positioning code was simplified when we added the new pointer styles).
We should reposition the pointers when the screen is resized, but should not do so every time the resize event is fired. An appropriate balance between accuracy and speed would be to hide the pointer as the window begins to resize, and show it again (thereby repositioning it) once the resize has completed (due to the resize event not being triggered for a set amount of time).
Agreed.
I think this can wait for 3.3.1 ?
screenshot