WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15615 closed defect (bug) (fixed)

Left admin menu slides open, hides closed

Reported by: johnjamesjacoby Owned by:
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.1
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

Noticed this a few weeks ago and figured it was probably temporary.

When you roll-open a top level admin menu, it animates open per normal. When you click to close it, it simply hides without any slide-up/close animation.

Attachments (3)

toggle_sldie_fix.diff (473 bytes) - added by greuben 4 years ago.
adding a delay for smooth slide
toggle_slide_fix.diff (466 bytes) - added by greuben 4 years ago.
fixed the typo
toggle-class-in-callback.15615.diff (512 bytes) - added by filosofo 4 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 @johnjamesjacoby4 years ago

Since we have the admin bar and the admin menu, I should add that I'm talking about the left side, traditional admin navigation and not the new top admin bar.

comment:2 @ocean904 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.1

Admin menu is the right name. Admin bar is the bar on the top.

Bug confirmed. It works in 3.0.1.

comment:3 @travisnorthcutt4 years ago

  • Cc travisnorthcutt added

comment:4 @travisnorthcutt4 years ago

Just cc-ing myself here because I'd like to follow this for learning purposes. If that's not kosher, please accept my humble apologies.

@greuben4 years ago

adding a delay for smooth slide

comment:5 @greuben4 years ago

  • Cc rgunday@… added
  • Keywords has-patch added; needs-patch removed

comment:6 follow-up: @travisnorthcutt4 years ago

I think there's a problem with that patch. "dispaly" should be "display". Even with that change, though, this doesn't affect the behavior for me.

@greuben4 years ago

fixed the typo

comment:7 in reply to: ↑ 6 ; follow-up: @greuben4 years ago

  • Severity changed from normal to minor

Replying to travisnorthcutt:

I think there's a problem with that patch. "dispaly" should be "display". Even with that change, though, this doesn't affect the behavior for me.

Make the slideToggle a little slower to see the effect.

var id = el.slideToggle(500, function() {
            el.delay(500).animate( {'display': ''}, 500);
		}).parent().toggleClass( 'wp-menu-open' ).attr('id');

comment:8 @filosofo4 years ago

The real question is why this was working in 3.0.x. The reason it shouldn't have worked is that the jQuery chained methods get executed before the callback called when the animation is complete. That means that the "wp-menu-open" class should be toggled in the callback, once the sliding animation is complete.

The best answer I have is that with every release, jQuery gets twice as fast. 3.0.x uses jQuery 1.4.2, and 3.1, 1.4.4. Folks, that's 4x as fast. I tried this with the trunk version of jQuery, and it was so fast that the sliding submenu actually went back in time.

So clearly we need the class toggle after the animation is complete, as in toggle-class-in-callback.15615.diff.

comment:9 in reply to: ↑ 7 @travisnorthcutt4 years ago

Replying to greuben:

Make the slideToggle a little slower to see the effect.

FWIW, this has no effect for me. I may be doing something wrong, though (in fact that would be my first suspicion).

comment:10 @nacin4 years ago

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

(In [16813]) Fix closing admin menu animation. props filosofo, fixes #15615.

comment:11 @nacin4 years ago

(In [16874]) Fix admin menu save state. props greuben, fixes #15767, see #15615.

Note: See TracTickets for help on using tickets.