Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#2932 closed enhancement (fixed)

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:
Blocked by: Blocking:


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 (7)

comment:1 Changed 15 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.change);

comment:2 Changed 15 years ago by rdworth


comment:3 Changed 15 years ago by paul


comment:4 Changed 14 years ago by Cloudream

Milestone: 1.6b1.6
Owner: changed from joern.zaefferer to paul
Status: newassigned

comment:5 Changed 14 years ago by paul

Resolution: fixed
Status: assignedclosed

Implemented in r692.

comment:6 in reply to:  5 Changed 14 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 14 years ago by rdworth

Milestone: 1.61.6rc2
Note: See TracTickets for help on using tickets.