Ticket #2932 (closed enhancement: fixed)

Opened 6 years ago

Last modified 5 years ago

Accordion event for start of animation

Reported by: nostrademons Owned by: paul
Priority: major Milestone: 1.6rc2
Component: ui.accordion Version: 1.5b4
Keywords: Cc:
Blocking: Blocked by:

Description

Could we get an event that's fired at the start of the accordion animation, instead of being fired as the animation completes like the existing accordionchange?

A couple use cases:

1.) Dynamically creating the contents of the accordion pane on-demand, in response to accordionchange events. Using the existing accordionchange event, this results in the animation being fired, then the contents being filled in after it completes. With a start event, the contents would be filled in first and then animated.

2.) Ensuring that an area of the screen is visible & properly setup whenever the appropriate accordion tab is open. For example, I have an event handler - triggered by something other than the accordion - that tries to activate a certain pane inside the accordion and then references components that are built only in response to that accordion pane being activated. Since accordionchange fires after the animation, it won't have executed when the call to accordion('activate') completes, and so the widgets I'm referencing in the event handler don't yet exist.

I've attached a patch that adds an 'accordionchangestart' event which fires before the animation (or before the 'accordionchange' event in the case of a non-animated accordion), which is adequate for my purposes and shouldn't disturb anything else.

Change History

comment:1 Changed 6 years ago by nostrademons

Attachment didn't work, I got a "Permission denied: '/opt/trac/attachments/ticket'" Trac error when adding it. The change was one line added to the beginning of toggle(), after the var declarations but before the options.running assignment:

$(this).triggerHandler("accordionchangestart", [options.data], options.change);

comment:2 Changed 6 years ago by rdworth

  • Milestone changed from 1.5 to 1.5.2

comment:3 Changed 6 years ago by paul

  • Milestone changed from 1.5.2 to 1.6b

comment:4 Changed 6 years ago by Cloudream

  • Owner changed from joern.zaefferer to paul
  • Status changed from new to assigned
  • Milestone changed from 1.6b to 1.6

comment:5 follow-up: ↓ 6 Changed 6 years ago by paul

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

Implemented in r692.

comment:6 in reply to: ↑ 5 Changed 5 years ago by sunshine

Replying to paul:

Implemented in r692.

Shouldn't this change be documented? Presently, documentation mentions only the end-of-animation accordionchange event.

comment:7 Changed 5 years ago by rdworth

  • Milestone changed from 1.6 to 1.6rc2
Note: See TracTickets for help on using tickets.