Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#22520 closed defect (bug) (fixed)

Toolbar JS with jQuery doesn't match non-jQuery behavior with hashes (e.g. read more link)

Reported by: helenyhou's profile helenyhou Owned by: azaozz's profile azaozz
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.3
Component: Toolbar Keywords: has-patch
Focuses: Cc:


In /wp-includes/js/admin-bar.js, we have a block that uses jQuery if available and then falls back to another block of plain JS if not. The JS version does the following to help prevent the toolbar from covering up content when a hash is present in the URL (w = window):

if ( w.location.hash )

The jQuery version does not seem to do the same, but it should. Patch is forthcoming.

Attachments (2)

patch-more-toolbar-offset.diff (307 bytes) - added by tlovett1 12 years ago.
Patches problem in wp-includes/js/admin-bar.js
patch-more-toolbar-offset-v1.diff (465 bytes) - added by tlovett1 12 years ago.
This version has the if statement within the jquery exists if

Download all attachments as: .zip

Change History (6)

12 years ago

Patches problem in wp-includes/js/admin-bar.js

12 years ago

This version has the if statement within the jquery exists if

#2 @helenyhou
12 years ago

patch-more-toolbar-offset-v1.diff works for me. patch-more-toolbar-offset.diff appears more ideal on first glance (moving it out of the if/else block since it's used in both places) but doesn't actually work, I suppose because it no longer waits until load.

#3 @azaozz
12 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 22728:

Toolbar: sync jQuery and non-jQuery JS behaviour when there's a hash in the url, props tlovett1, fixes #22520

#4 @helenyhou
12 years ago

  • Milestone changed from Awaiting Review to 3.5
Note: See TracTickets for help on using tickets.