Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#19021 closed defect (bug) (fixed)

Broken pointers if attached to elements visible after scrolling page

Reported by: kkarpieszuk Owned by: koopersmith
Priority: normal Milestone: 3.4
Component: Administration Version: 3.3
Severity: minor Keywords: needs-patch 3.3.1
Cc: Focuses:

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)

pointer-error.png​ (16.9 KB ) - added by kkarpieszuk 15 years ago.
screenshot
19021.diff​ (430 bytes ) - added by blepoxp 15 years ago.
Reposition on screen resize or scroll

Download all attachments as: .zip

Change History (14)

#1 @kkarpieszuk
15 years ago

  • Summary Broken pointers if attached to elements visible after scroll of page → Broken pointers if attached to elements visible after scrolling page

#2 @ryan
15 years ago

  • Milestone Awaiting Review → 3.3

#3 @blepoxp
15 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.

@blepoxp
15 years ago

Reposition on screen resize or scroll

#4 @ocean90
15 years ago

  • Component Widgets → Administration
  • Owner set to koopersmith
  • Status new → reviewing

#5 @jane
15 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 @ocean90
15 years ago

A blocker not, but to re-position the pointer if the screen will be resized makes sense.

#7 follow-up: @koopersmith
15 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed
  • Severity normal → 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 @westi
15 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 ?

#9 @jane
15 years ago

@westi: Yes. Assuming 80%+ with a regular screen that's not being resized on the single instance they see the pointers before dismissing them, we shouldn't be bothering with this. They are they and they work as intended (show up, go away). Can refine in future versions.

#10 @jane
15 years ago

  • Keywords 3.3.1 added
  • Milestone 3.3 → Future Release

#11 @koopersmith
15 years ago

  • Resolution → fixed
  • Status reviewing → closed

In [19713]:

Improve pointer collision handling. fixes #19021.

#12 @SergeyBiryukov
15 years ago

  • Milestone Future Release → 3.4
Note: See TracTickets for help on using tickets.