Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Collapse: Support for pre/post collapse/expand callbacks #5194

Closed
nonplus opened this issue Jan 10, 2016 · 3 comments
Closed

Collapse: Support for pre/post collapse/expand callbacks #5194

nonplus opened this issue Jan 10, 2016 · 3 comments

Comments

@nonplus
Copy link
Contributor

nonplus commented Jan 10, 2016

In my application, before expanding a collapsed section, I need to populate the contents. Similarly, after collapsing an expanded section, I'd like to do some cleanup.

It would be great if the uib-collapse supported additional attributes that would be evaluated before and after the collapse animation, e.g. expanding, expanded, collapsing, collapsed. If the "before" attribute (collapsing/expanding) returns a promise, the directive should wait for it to resolve before beginning the collapse/expand animation.

Specifically, I'd like to be able to do something like this:

<div uib-collapse="isOpen" expanding="setupContent()" collapsed="cleanupContent()">
    <!-- complex & expensive content goes here -->
</div>

FWIW, I have an implementation and can create a PR if there is general interest in this...

@wesleycho
Copy link
Contributor

I think this is a simple enough feature & should be simple enough to implement - I'm open to this.

@deeg
Copy link
Contributor

deeg commented Jan 12, 2016

@nonplus, do you have a PR you are going to put up, or should someone else look into implementing this?

@nonplus
Copy link
Contributor Author

nonplus commented Jan 12, 2016

I need to write the unit test before providing a PR. Hopefully I can do that tonight.

nonplus added a commit to nonplus/bootstrap that referenced this issue Jan 13, 2016
nonplus added a commit to nonplus/bootstrap that referenced this issue Jan 13, 2016
nonplus added a commit to nonplus/bootstrap that referenced this issue Jan 14, 2016
@wesleycho wesleycho added this to the 1.0.4 milestone Jan 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants