Problem/Motivation

In order to access the displace properties we should use Drupal.displace as an object so instead use Drupal.displace().top we should use Drupal.displace.offsets.top.

Proposed resolution

Replace all occurrences of Drupal.displace().top by Drupal.displace.offsets.top.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

N/A

CommentFileSizeAuthor
drupal-displace-fix.patch659 bytesrteijeiro
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Component: javascript » comment.module
Status: Needs review » Reviewed & tested by the community
Issue tags: +JavaScript, +quickfix, +Spark

Note: I introduced this apparently incorrect use of Drupal.displace in #1991684: Node history markers (comment & node "new" indicator, "x new comments" links) forces render caching to be per user. My bad!

I did manual testing of this patch, and this indeed continues to work correctly.

Thanks, rteijeiro!

nod_’s picture

Well it's not incorrect per-say, it's just less efficient :)

nod_’s picture

and it'd be nice if we fixed that in a more generic way: #1870006: HTML5 validation with table sticky header is misaligned over the toolbar

Wim Leers’s picture

#3: agreed, but the comment "new" indicator and accompanying #new fragment are a special case: the #new fragment is inserted dynamically, since #1991684: Node history markers (comment & node "new" indicator, "x new comments" links) forces render caching to be per user, to not break the render cache. In any case, I support that principle, and threw a review your way :)

jessebeach’s picture

Looks good.

Xano’s picture

drupal-displace-fix.patch queued for re-testing.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.