Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

feat(events): expose uis-open-close callback #1723

Merged
merged 1 commit into from
Jul 30, 2016

Conversation

Den-dp
Copy link
Contributor

@Den-dp Den-dp commented Jul 12, 2016

In order to push this feature (#1153) I'm suggesting this PR which has a slightly updated and rebased code with a couple of unit tests.
If all this makes sense but some changes are required please let me know.

Closes #432 #1153

@Den-dp
Copy link
Contributor Author

Den-dp commented Jul 15, 2016

@user378230 hey, Is this feature in general fits in current roadmap or for now entire codebase is in "maintenance only" mode?

@user378230
Copy link
Contributor

Could you extract this as a separate directive? (See: Accessing $select)

@Den-dp
Copy link
Contributor Author

Den-dp commented Jul 16, 2016

@user378230 Yep, this is a very good idea. But not sure which path to choose:


Extract this functionality to a separate directive called uiSelect (directive stacking) with two optional attributes on-open and on-close.

pros: 👍

  • provides nice developer experience because ui-select directive is already in place and putting on-open and/or on-close is on developer
  • only one $watch

cons: 👎

  • the abuse of directive stacking

Or create two separate directives: on-open and on-close

pros: 👍

  • same as in previous from the usage perspective
  • kind of more readable code

cons: 👎

  • introduces two $watchers (one per directive)

@user378230
Copy link
Contributor

Or create two separate directives: on-open and on-close

pros:

same as in previous from the usage perspective
kind of more readable code
cons:

introduces two $watchers (one per directive)

One directive (Eg. (uis)OpenCloseCallback or (uis)OpenClose?), one callback and pass true/false to callback for isOpen

@Thirsa
Copy link

Thirsa commented Jul 22, 2016

It works for me! would love to see this merged 👍

@Den-dp
Copy link
Contributor Author

Den-dp commented Jul 22, 2016

@Thirsa Thank you for your interest in this PR. I will get it done by this weekend.
Also it is worth noting that API will be slightly changed according to @user378230 comment.

@Den-dp
Copy link
Contributor Author

Den-dp commented Jul 24, 2016

Ok, here is how it looks like after refactoring.

@user378230 when you got some time please take a look and share your thoughts on this.
So if this "api" looks bad we can work it out.

Thanks

@Thirsa
Copy link

Thirsa commented Jul 25, 2016

This works smoothly for me as well 👍

@Den-dp Den-dp changed the title feat(events): expose on-open and on-close callbacks feat(events): expose uis-open-close callback Jul 28, 2016
@user378230 user378230 merged commit 21bcd5e into angular-ui:master Jul 30, 2016
@user378230
Copy link
Contributor

@Den-dp can you add notes Wiki prior to release? Thanks!

@Den-dp
Copy link
Contributor Author

Den-dp commented Aug 1, 2016

@user378230 done. https://github.com/angular-ui/ui-select/wiki/uis-open-close Looks pretty simple, but should be a good starting point.

@ceeram
Copy link

ceeram commented Aug 1, 2016

Might be handy to mention the version in which this was added?

Op 1 aug. 2016 15:56 schreef "Denis Bendrikov" notifications@github.com:

@user378230 https://github.com/user378230 done.
https://github.com/angular-ui/ui-select/wiki/uis-open-close Looks pretty
simple, but should be a good starting point.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1723 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGzWF_bJ3YIA8la_gL-eNVvNvY7fPO9ks5qbfsYgaJpZM4JK3ZJ
.

@Den-dp
Copy link
Contributor Author

Den-dp commented Aug 2, 2016

@ceeram yes, it's easy. Not 100% sure what version will be the next though 😄

@PhilDore11
Copy link

Is this included in v0.19.1?

@Den-dp
Copy link
Contributor Author

Den-dp commented Aug 9, 2016

@PaulL1 Hi. Despite on the changelog this feature has landed in 0.19.2.

I have added a note to the wiki page.

@ceeram
Copy link

ceeram commented Aug 9, 2016

it is in 0.19.0 already : https://github.com/angular-ui/ui-select/commits/v0.19.0

it is incorrectly listed in the changelogs

@PhilDore11
Copy link

@Den-dp When is 0.19.2 supposed to drop?

@Den-dp
Copy link
Contributor Author

Den-dp commented Aug 9, 2016

@ceeram

it is in 0.19.0 already

Unfortunately this is not quite true for npm. You can try to search for openClose in here https://npmcdn.com/ui-select@0.19.0/dist/select.js

The fun part is this directive is available in src https://npmcdn.com/ui-select@0.19.0/src/ in the same npm package.

@PhilDore11 0.19.2 is already available in npm.

@pdore-netfore
Copy link

@Den-dp Is that also true for bower?

@Den-dp
Copy link
Contributor Author

Den-dp commented Aug 9, 2016

@pdore-netfore sorry, but it is not.

It looks like you should wait for the 0.19.2 tag https://github.com/angular-ui/ui-select/tags (bower reads this tags to get a list of available versions) or maybe file an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants